Technology and Beyond (TaB)

Full Version: ab -- ApacheBench
You're currently viewing a stripped down version of our content. View the full version with proper formatting.


ab is a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server.
It can generate specific HTTP requests to the testing URL, and present a detailed report for the test.

A quick 100-way stress test could be:

ab -n 100 -c 100 -k

Some frequently using options:
Quote:-c: ("Concurrency"). Indicates how many clients (people/users) will be hitting the site at the same time. While ab runs, there will be -c clients hitting the site. This is what actually decides the amount of stress your site will suffer during the benchmark.

-n: Indicates how many requests are going to be made. This just decides the length of the benchmark. A high -n value with a -c value that your server can support is a good idea to ensure that things don't break under sustained stress.

-k: This does the "KeepAlive" functionality browsers do by nature. Since browsers do this and you're likely to want to simulate the stress and flow that your site will have from browsers, it is recommended you do a benchmark with this.

If you are confused with the test result, you can use tcpdump to collect detailed info for each requests.


20160501yxj: add frequently using options and references
Reference URL's