Apache Benchmark Executor

About

Apache Benchmark is a tool for benchmarking your HTTP server. Taurus supports the following features of Apache Benchmark:

  • iterations: number of requests to make
  • concurrency: number of multiple requests to make at a time (defaults to 1).
  • hold-for: run load testing for specified duration
  • timeout: maximum number of seconds to wait before the socket times out
  • headers: headers to attach to HTTP request
  • keepalive: use HTTP KeepAlive feature (you can use it on two levels - global for whole scenario and local for some requests)

Keep in mind the following rules when using executor: ab:

  • You cannot specify more than one request in requests section.
  • Apache Benchmark supports only GET requests.
  • timeout option is not supported.
  • You should have Apache Benchmark installed.

Scenario Samples

Simplest working example:

execution:
- executor: ab
  scenario: simple

scenarios:
  simple:
    requests:
    - http://blazedemo.com/

Example of hold-for and timeout usage:

execution:
- executor: ab
  hold-for: 30s
  scenario: simple

scenarios:
  simple:
    timeout: 1s
    requests:
    - http://blazedemo.com/

Complex example:

execution:
- executor: ab
  concurrency: 20
  iterations: 1000
  scenario: complex
 

scenarios:
  complex:  
    keepalive: false
    headers:
      Content-Type: text/plain
    requests:
    - url: http://blazedemo.com/
      headers:
        X-Answer: 42

Module Settings

If you have Apache Benchmark in non-standard location, use path option to point Taurus to the ab. Also, you can pass specific Apache Benchmark options via cmdline:

modules:
  ab:
    path: /home/john/build/apache2/bin/ab
    cmdline: -e csv-file