Command line options

The most common and useful options for AB are the following: -h Displays help and usage. -n requests The (absolute) number of requests to perform for the benchmarking session. The default is 1. Keep in mind that AB does not implement thinktime! If you set the number of requests too high then you will effectively perform a denial-of-service attack on your server. -c concurrency The number of simultaneous requests to perform (virtual users). The default is 1, which means no concurrency. -v level Used to set the verbosity level. Level 2 and higher will print HTTP headers and the HTTP response body. -A username:pass Used to supply basic authentication credentials to the server. -C name=value Add a cookie-header with name and value to the requested object.

Note The number of requests is not set per concurrent user. If you specify -n 20 and -c 10, each of the 10 virtual users will only perform two requests!

As an example, the command for stress testing the Trade3 primitive PingJSP using ApacheBench is:

C:\Program Files\IBM HTTP Server 2.0\bin> ab -g test -c 5 -n 50 
"http://cluster.itso.ibm.com/trade/PingJsp.jsp"

In this example we perform 50 requests using five virtual users, that is each of the virtual users performs 10 requests.

'The results of an ApacheBench stress test returns values such as:
Time taken for tests
Requests per second
Time per request (mean)
Time per request (mean, across all concurrent requests)
Transfer rate (Kbytes/sec)
Percentage of the requests served within a certain time
and more

  Prev | Home | Next

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.