Again, we will try to verify the results reported by
ab (claiming that the script under test can
handle about 855 requests per second on our machine). Therefore we
run http_load with a rate of 860 requests per
second, for 5 seconds in total. We invoke is on the file
urls, containing a single URL:
https://localhost/perl/simple_test.pl
Here is the generated output:
panic% http_load -rate 860 -seconds 5 urls
4278 fetches, 325 max parallel, 25668 bytes, in 5.00351 seconds
6 mean bytes/connection
855 fetches/sec, 5130 bytes/sec
msecs/connect: 20.0881 mean, 3006.54 max, 0.099 min
msecs/first-response: 51.3568 mean, 342.488 max, 1.423 min
HTTP response codes:
code 200 -- 4278
This application also reports almost exactly the same response-rate
capability: 855 requests per second. Of course, you may think that
it's because we have specified a rate close to this
number. But no, if we try the same test with a higher rate:
panic% http_load -rate 870 -seconds 5 urls
4045 fetches, 254 max parallel, 24270 bytes, in 5.00735 seconds
6 mean bytes/connection
807.813 fetches/sec, 4846.88 bytes/sec
msecs/connect: 78.4026 mean, 3005.08 max, 0.102 min
we can see that the performance goes down—it reports a response
rate of only 808 requests per second.
The nice thing about this utility is that you can list a few URLs to
test. The URLs that get fetched are chosen randomly from the
specified file.
Note that when you provide a file with a list of URLs, you must make
sure that you don't have empty lines in it. If you
do, the utility will fail and complain:
./http_load: unknown protocol -