httpload
httpload copied to clipboard
An event loop based http testing multiprocessing tool.
httpload: event loop based multiprocessing HTTP load test tool
Introduction
httpload is a tool for testing web sites. It issues a series of HTTP requests in parallel. The URLs to be hit are read from a file and tried randomly. It runs a single process. It's particularly adequate for testing asynchronous web servers in multi-core/multi-cpu machines like Nginx or Lighttpd.
The original tool was created by Jef Poskanzer.
This version is IPv6 and SSL/TLS enabled.
Vanilla installation
-
Clone the repo from git://github.com/perusio/httpload.git or grab the tarball from downloads.
-
Issue
make
&make install
. By default the binary will be installed under/usr/bin
and the man page under/usr/share/man/man1
. -
Done.
Debian package installation
-
Either download the binary package from debian.perusio.net or download the source package and build from source while following the instructions.
-
Done.
Usage
httpload
requires you to specify an option for starting the
connection and one for terminating the connection.
-
-parallel
or-rate
for starting. -
-seconds
or-fetches
for terminating.
Additionally a -jitter
option specifies that the rate given in
-rate
varies up to 10%.
The URLs in the URL file are visited in random order. You can specify the seed of the random number generator with:
-
-seed integer
The -seed
option was added by
Tim Bunce.
httpload
can query HTTPS based servers. If you don't specify the
cipher using:
-
-ciphers str
wherestr
is a openssl cipher specification string.An example is
ECDHE-RSA-AES256-SHA
.
A complete example of querying the URLs specified in file
test_url_s.txt
using the given cipher.
httpload -cipher ECDHE-RSA-AES256-SHA -parallel 10 -seconds 10 test_url_s.txt
279 fetches, 10 max parallel, 11997 bytes, in 10.0124 seconds
43 mean bytes/connection
27.8654 fetches/sec, 1198.21 bytes/sec
msecs/connect: 33.6593 mean, 347.213 max, 0.037 min
msecs/first-response: 247.849 mean, 378.282 max, 31.069 min
HTTP response codes:
code 200 -- 279
The tool accepts three shortcut names for a fast, high and paranoid cipher. Notwithstanding the fast cipher is not that fast, since it only accepts SSLv3+ ciphers. There are speed diferences between them. The shortcuts are:
-
fastsec
- CAMELLIA128-SHA -
highsec
- AES256-SHA -
paranoid
- DHE-RSA-AES256-SHA
The complete usage documentation is on the manpage.
Additional scripts for load testing
There are two scripts for load testing on the contrib
subdirectory:
-
httpload-make-test-files
- creates a given number of 1kB/1MB sized files for testing purposes. The files are named01_kB_testfile.txt
,02_kB_testfile.txt
...,01_MB_testfile.txt
,02_MB_testfile.txt
..., respectively.The original script was created by chaoslawful.
Examples:
Create ten 1 kB files.
httpload-make-test-files -k 10
Create seven 1 MB files.
httpload-make-test-files -m 7
-
httpload-single
- starts a load test usinghttpload
using a single URL. This is just a wrapper around httpload. It functions as a stopgap solution until support for such is included in the C program.Example:
httpload-single -parallel 10 -seconds 30 http://example.com/img.jpg
Comparison with other testing tools
-
ab
:httpload
differs significantly fromab
, since uses the Apache Portable Runtime which uses threads instead of a single process (loop) likehttpload
.ab
is CPU bound. -
siege
: also relies on threads contrary tohttpload
that uses a single process (loop).