Archive

Posts Tagged ‘benchmarks’

ab – Apache Benchmark

August 8, 2008 4 comments

ab (Apache Benchmark) is a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server. It provides a quick an easy way to evaluate your http serving capabilities. ab overloads the server with http requests and measures the time it takes to serve all those requests.

The benchmark is intended for all available versions of Apache through 2.x.

A very common question is how to install ab and where to get it. The real thing is that ab comes preconfigured with your apache installation. Apache by himself is just an extension command for the Apache Web Server. So if you have already installed Apache, then you should also have the ab benchmarking tool.

What we need in order to get ab to work is type the command and append the URL address we want to test. The command is issued as follows:

# ab -n100 -c10 http://localhost:8080/index.jsp

Lets see an example screen:

The -n parameter tells ab the number of connections to send to the server. In this case we are sending just 10, while the -c means the number concurrent requests to be made. The -k option activates the KeepAlive feature and the -t is the timelimit (in seconds)for apache to spend for benchmarking.

The number of connections is the most important parameter, the first times set it to a prudent level of connections and try with different values, increase this value until you get satisfied with the benchmarking; An ab test makes consumption of the server RAM, resources, bandwidth and processor so if you put a brutally high number of connections on an underpowered server, it may get out of resources.

ab is a very simple and useful command line application. It can be understood and performed with ease on almost any kind of Apache server.

As a matter of fact, the ab testing mechanism actually is a good example of a Denial of Service (DoS) attack. Of course ab is not as dangerous and stealthy, and although its very unlikely for it to effectively damage a server, the basis remains the same.

For further information, you can always check the official webpage.

Categories: Apache Tags: ,