How to Check Detailed Response Timing of a Website from Linux Command Line using Curl
Analyzing your server response time and website performance on regular basis is one of the most important tasks. Let me say it little straightforward here, it does not matter how good your website is, how much you have spent in building it up. First of all, everything that matters is how fast your website loads.
Many people focus on building up trendy websites which require many images, third-party scripts, include many css files and js scripts on the homepage. Using custom name servers for your website, Setting up servers in the wrong location, even using a lot of redirections could be the reason for the sluggishness of your website. If a website is taking more than 10 seconds to load then there is a big possibility of heavy traffic loss. This could also affect you on SEO parameters. Google and other search engines will keep your website on lower rankings.
Today, we have come up with the tutorial using which you can analyze the performance and statistics of your server and application performance. We believe that the first step towards making things right is to analyze the problems and latency you have in your setup.
Prerequisite
We are using curl to analyze the detailed response time of a website on Linux Command Line. The machine used for this tutorial is ubuntu 16.04. Install curl using below command if it is not installed on your system.
apt-get install curl
Command
curl -s -w '\nLookup time:\t%{time_namelookup}\nConnect time:\t%{time_connect}\nAppCon time:\t%{time_appconnect}\nRedirect time:\t%{time_redirect}\nPreXfer time:\t%{time_pretransfer}\nStartXfer time:\t%{time_starttransfer}\n\nTotal time:\t%{time_total}\n' -o /dev/null http://linuxtogether.org
Command Usage & Output
ubuntu@ip-172-31-12-106:~$ curl -s -w '\nLookup time:\t%{time_namelookup}\nConnect time:\t%{time_connect}\nAppCon time:\t%{time_appconnect}\nRedirect time:\t%{time_redirect}\nPreXfer time:\t%{time_pretransfer}\nStartXfer time:\t%{time_starttransfer}\n\nTotal time:\t%{time_total}\n' -o /dev/null http://linuxtogether.org Lookup time: 0.004 Connect time: 0.005 AppCon time: 0.000 Redirect time: 0.000 PreXfer time: 0.005 StartXfer time: 0.005 Total time: 0.005
Detailed Description
Option | Description |
---|---|
Lookup time (time_namelookup) |
The time it took from the start until the name resolving was completed. Time calculation is in seconds. See More for a detailed explanation. |
Connect time (time_connect) |
The time it took from the start until the connection to the remote host (or proxy) was completed. Time calculation is in seconds. See More for a detailed explanation. |
AppCon time (time_appconnect) |
The time it took from the start until the SSL connect/handshake with the remote host was completed. Time calculation is in seconds. See More for a detailed explanation. |
Redirect time (time_redirect) |
The time it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started. So, this is zero if no redirection took place. Time calculation is in seconds. .See More for a detailed explanation. |
PreXfer time (time_pretransfer) |
The time it took from the start until the file transfer is just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved. Time calculation is in seconds. See More for a detailed explanation. |
StartXfer time (time_starttransfer |
The time it took from the start until the first byte is received by libcurl. This includes PRETRANSFER_TIME and also the time the server needs to calculate the result. Time calculation is in seconds. See More for a detailed explanation. |
Total time (time_total) |
The time it took for the previous transfer, including name resolving, TCP connect etc. Time calculation is in seconds. See More for a detailed explanation. |
In the end, we hope above post will help you to find out the sluggishness and latency in your website. Fixing up these issues will definitely bring up the higher traffic, good SEO ranking and overall a satisfaction to your work. Stay tuned for more updates. Share and like the post if you find it useful. Thanks!
Ӏ do agree with all the concepts you have introduced on your post.
They are really convincing and can definitely work. Still, the posts
arе tⲟo quіck for novices. May just you please extend tһem a bit from ѕubsequent time?
Thank you for the post.
Thanks for liking the post @Jump. We will try to make our posts simpler so those novice users can also understand them.
What’s սp, I would like to subscribe for this weƄ
site tо get hottest updates, so wһere сan i do it please help out.
We are working on UI change and will add that asap. Thanks for showing up the interest.
Greɑt poѕt.
Heⅼlo There. I discoverеⅾ your weblog using msn. That is a really neatly written article.
І will be sure to bookmark it and return to
learn extra of your useful information. Tһɑnks for tһe post.
I’ll certainly comеbаcк.
Heya i’m for the primary time here. I came across this board and I find It truly helpful & it helped me out a lot.
I’m hoping to offer something back and help others like
you aided me.
Sure I am completely okay with it. 🙂