Sunday, April 27, 2008

Using httping to measure the Lateceny and Throughput of Webservers

# For measuring the latency. Press CTRL+c to exit the program.

$ httping -g URL [-p port]

You can also connect using SSL, for this to work you need to give a https url or a 443 portnumber:
$ httping -l -g https://www.cyberciti.biz # Or
$ httping -g http://www.cyberciti.biz -p 443

# Measure throughput of a webserver

-G forces GET request instead of a HEAD request - this means that also the complete page/file must be transferred. You also need to pass -b along with -G to get the transferspeed (in KB/s).
$ httping -Gbg http://www.cyberciti.biz/

...
--- http://www.cyberciti.biz/ ping statistics ---
53 connects, 53 ok, 0.00% failed
round-trip min/avg/max = 1451.9/2013.6/11656.0 ms
Transfer speed: min/avg/max = 6/19/24 KB

Please note the above command does not measure the latency!

You can also pass -X with -G to show the amount of data transferred (excluding the headers):
$ httping -XGbg http://www.cyberciti.biz/

...
--- http://www.cyberciti.biz/ ping statistics ---

7 connects, 7 ok, 0.00% failed
round-trip min/avg/max = 1507.7/1693.4/2620.3 ms
Transfer speed: min/avg/max = 9/21/24 KB

# Test remote server CPU

-B along with -G ask the webserver to compress the returned data - this will reduce the influence of the bandwidth of your connection while increasing the influence of the processorpower of the HTTP server.
$ httping -BGg http://www.cyberciti.biz/


# Flood server

-f flood ping i.e. do not sit idle between each ping but ping as fast as the computer and network allow you to (don't run this on production or 3rd party servers):
$ httping -fg http://www.cyberciti.biz/

No comments: