ApacheBench

ApacheBench (AB) is a very simple tool for quickly generating HTTP GET and POST requests. It is part of the Apache HTTP Server and the IBM HTTP Server powered by Apache. It is automatically installed with IBM HTTP Server and the executable can be found in <IHS_HOME>\bin\ab. For a manual and list of options, refer to:

http://httpd.apache.org/docs/programs/ab.html

Note We have noticed that the AB executable is not part of every IBM HTTP Server distribution: it is not included in the currently available version 1.3.28, but it is again delivered with version 2.0.42.2.

However, you can always download the Apache HTTP Server source-code from the following Web site and compile the AB utility yourself:

http://httpd.apache.org/download.cgi

ApacheBench was mainly designed as a benchmarking tool, and it is only usable for very basic load testing because of several limitations: It has no functionality to record a browser click stream and requests have to be specified on the command line. Although the HTTP POST method is supported, POST request data has to be put into a file before the request is sent. There is no support for distributed tests, nor does it provide any graphical representation of the test result data. It cannot be used for scripting of scenarios or testcases, and can merely test one URL at a time. It cannot retrieve cookie data from the response, although cookie information can be specified on the command line, making session-aware performance testing possible in a very limited way.

Attention: Be especially aware of one AB limitation: it does not verify the HTTP response!

For example, if your appserver returns a "500 Internal Server Error" in 5 ms for a page request you might get the impression that your system is super fast! Always do a test run first with the -v (verbose mode) option enabled to have the response code printed out!

Nevertheless, AB has several advantages: It is free, very easy and quick to use, and there is no additional setup required as it is part of IBM HTTP Server. It can be useful for very simple and ad-hoc performance tests, where the goal is for example to stress a Web server or appserver to get a rough idea of how many requests (of one kind) can be processed per second. Another use can be to stress the application server, creating a multitude HTTP sessions at a time, while using Tivoli Performance Viewer to monitor the servers' performance. The example shows a sample ApacheBench run stress testing the Trade3 Web primitive PingJSP.

Important: Be careful when selecting the URL you wish to test with AB. As you can only specify one URL at a time as the input parameter, make sure to select the URL you really mean to test!

Sometimes a Webpage (in our example the Trade3 main URL http://<your_host>/trade/) will provide a detailed display view which is generated in several steps:

1. First the browser retrieves the response from the server which merely contains a frameset or a redirect, and will then:

2. Create additional requests to receive the actual content, like images, and so forth.

ApacheBench is by no means a browser and does not know about framesets, links, images, or dynamic content like Javascript; it will not follow any redirects or even resolve simple HTML <img src> tags to retrieve images. This behavior will certainly falsify your performance results if not minded! Following our Trade3 example, be sure to use a request URL that returns meaningful data - not only redirects or framesets - from the appserver.

For example, use: http://<your_host>/trade/PingJsp.jsp http://<your_host>/trade/scenario

  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.

 

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