TECHIES WORLD

For Techs.... Techniques.... Technologies....

ApacheCpanelLinuxMysqlPHP

How to check the website response time through command-line

Website response time is an important factor in hosting set up. In Linux we can check the webdite response time using the curl utility.

#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://techies-world.com

The result of this command will be in the below format.

Lookup time:    0.509
Connect time:   0.871
AppCon time:    0.000
Redirect time:  0.000
PreXfer time:   0.871
StartXfer time: 3.096

Total time:     3.830

Different options used in this command are explained for reference.

Option                                                Description
-s                                                     Quiet mode. Don't show progress meter or error messages
-w                                                    Defines what to display on stdout after a completed and       successful operation
-o                                                     Write output to '/dev/null'
time_total                                        The total time, in seconds, that the full operation lasted
Lookup time (time_namelookup)    The time, in seconds, it took from the start until the name resolving was completed
Connect time (time_connect)           The time, in seconds, it took from the start until the TCP connect to the remote host was completed
PreXfer time (time_pretransfer)       The time, in seconds, it took from the start until the file transfer was just about to begin. This includes all 'pre-transfer' commands and negotiations that are specific to the particular protocol(s) involved
StartXfer time (time_starttransfer)    The time, in seconds, it took from the start until the first byte was just about to be transferred. This includes 'time_pretransfer' and also the time the server needed to calculate the result
AppCon time (time_appconnect)     The time, in seconds, it took from the start until the SSL/SSH/etc connect/handshake to the remote host was completed
Redirect time (time_redirect)            The time, in seconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before the final transaction was started 'time_redirect' shows the complete execution time for multiple redirections.

 

Leave a Reply