19.5. Testing HTTP Throughput and Latency with httping
Problem
As always, your users are complaining "the web site is too slow! We're dying here!" But it seems OK to you. Isn't there some way you can make some objective measurements without having to master some expensive, complicated analysis tool?
Solution
While sophisticated HTTP server analysis tools are nice, and there are dozens of them, sometimes you just want something quick and easy. httping is an excellent utility for measuring HTTP server throughput and latency, and because it's a tiny command-line tool, you can easily run it from multiple locations via SSH.
Its simplest invocation is to test latency:
$ httping -c4 -g http://www.oreilly.com
PING www.oreilly.com:80 (http://www.oreilly.com):
connected to www.oreilly.com:80, seq=0 time=177.37 ms
connected to www.oreilly.com:80, seq=1 time=170.28 ms
connected to www.oreilly.com:80, seq=2 time=165.71 ms
connected to www.oreilly.com:80, seq=3 time=179.51 ms
--- http://www.oreilly.com ping statistics ---
4 connects, 4 ok, 0.00% failed
round-trip min/avg/max = 165.7/173.2/179.5 msThat's not too bad. This doesn't tell you how long it takes
pages to load, only how long it takes the server to respond to a HEAD
request, which means fetching only the page headers without the
content. So, let's do a GET (-G)
request, which fetches the whole page:
$ httping -c4 -Gg http://www.oreilly.com PING www.oreilly.com:80 (http://www.oreilly.com): connected to www.oreilly.com:80, seq=0 time=1553.78 ...Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access