≡ Menu

How to measure the latency, throughput and speed of a web server?

The question – I need to measure the latency and throughput of my web server. Is there a Linux SSH shell commmand that I can use to do this?

There is a Linux command called httping which can be used to do this very quickly!

The httping command can measure the latency and throughput of your web server. The command is very versatile and can be used to determine the speed of a web server.

If you do not have the httping command installed, please follow the steps in this article.

The ping command on one hand determines the latency of the network to respond to the ICMP echo requests. The httping command does this over HTTP. By default it does a HEAD HTTP request and gets just the headers from the server.

httping -g http://www.google.com -c 3 -i 1 -p 80

The above command will send 3 HEAD requests to www.google.com (-c) with an interval of 1 second (-i) on port 80 (-p).

The output of the command is:

ewhathow@ewhathow.com [~]# httping -g http://www.google.com -c 3 -i 1 -p 80
PING www.google.com:80 (/):
connected to 74.125.131.103:80 (769 bytes), seq=0 time=295.78 ms
connected to 74.125.131.105:80 (769 bytes), seq=1 time=220.39 ms
connected to 74.125.131.99:80 (769 bytes), seq=2 time=208.39 ms
--- http://www.google.com/ ping statistics ---
3 connects, 3 ok, 0.00% failed, time 2725ms
round-trip min/avg/max = 208.4/241.5/295.8 ms

This shows the latency of the server www.google.com.

Now if you want to download information by doing a GET request instead of a HEAD request, you can use the following command:

httping -g http://www.google.com -c 3 -i 1 -p 80 -G -b

Here, the -G option instructs httping to do a GET request and actually download the file from the web site. The -b option instructs httping to show the download speed. Finally, the httping command shows the average throughput of the server.

ewhathow@ewhathow.com [~]# httping -g http://www.google.com -c 3 -i 1 -p 80 -G -b
PING www.google.com:80 (/):
connected to 74.125.131.99:80 (1422 bytes), seq=0 time=211.38 ms  13496KB/s
connected to 74.125.131.147:80 (1422 bytes), seq=1 time=217.24 ms  12401KB/s
connected to 74.125.131.104:80 (1422 bytes), seq=2 time=222.76 ms  11789KB/s
--- http://www.google.com/ ping statistics ---
3 connects, 3 ok, 0.00% failed, time 2652ms
round-trip min/avg/max = 211.4/217.1/222.8 ms
Transfer speed: min/avg/max = 11789.003609/12562.182617/13496.273047 KB

The above report shows that the average speed with which www.google.com responds to HTTP GET requests is 12562 KB per second. The average time it took to download the page from the site was 217 milliseconds.

That’s it! You have now measured the latency and throughput of www.google.com. Replace it with your own web server and see how it does as compared to google.com!

Comments on this entry are closed.