Testing performance of HTTP server with Apache Bench

To benchmark a HTTP server, you can use the command-line utility Apache Bench (command ab).

If you have Python installed, you can start a HTTP server, e.g. running on port 10000, in any directory of your system. It will serve the files in that directory and sub-directories. Start it like this:

$ python -m SimpleHTTPServer 10000
Serving HTTP on 0.0.0.0 port 10000 ...

To test the number of requests it can handle per second, you can use Apache Bench, which is invoked with the command ab:

$ ab -n2000 -c10 http://127.0.0.1:10000/

This will shoot off 2000 requests at the server, with a concurrency level of 10 (10 threads performing requests in parallel).

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.