Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
145 lines (96 sloc) 4.83 KB

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

  1. Clone the repo from git://github.com/perusio/httpload.git or grab the tarball from downloads.

  2. Issue make & make install. By default the binary will be installed under /usr/bin and the man page under /usr/share/man/man1.

  3. Done.

Debian package installation

  1. Either download the binary package from debian.perusio.net or download the source package and build from source while following the instructions.

  2. 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 where str 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:

  1. httpload-make-test-files - creates a given number of 1kB/1MB sized files for testing purposes. The files are named 01_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 
    
  2. httpload-single - starts a load test using httpload 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 from ab, since uses the Apache Portable Runtime which uses threads instead of a single process (loop) like httpload. ab is CPU bound.

  • siege: also relies on threads contrary to httpload that uses a single process (loop).

TODO

  1. Implement CSV output for statistical and graphical treatment of the test results.

  2. Implement a single URL target given on the command line. For now the httpload-single shell script is a stopgap solution for such.

  3. Implement epoll(7) I/O event notification in Linux as an alternative to select(2).

Jump to Line
Something went wrong with that request. Please try again.