linux poison RSS
linux poison Email

Measuring the Performance of HTTP Web Servers using ApacheBench (ab)

ApacheBench is a command line utility for measuring the performance of HTTP web servers, in particular the Apache HTTP Server. It was designed to give an idea of the performance that a given Apache installation can provide. In particular, it shows how many requests per second the server is capable of serving.

The ab tool comes bundled with the standard Apache source distribution, and like the Apache web server itself, is free, open source software and distributed under the terms of the Apache.

Using ApacheBench (ab):
Suppose we want to see how fast Yahoo can handle 100 requests, with a maximum of 10 requests running concurrently:

ab -n 100 -c 10 http://www.yahoo.com/



As you can see this is very useful information, it returned requests at a rate of 16.50 requests per second, the fastest request was 556ms, the slowest 830ms.

Suppose you wanted to test multiple url's concurrently as well? You can do this by creating a shell script, with multiple ab calls. At the end of each line place an & this makes the command run in the background, and lets the next command start execution. You will also want to redirect the output to a file for each url using > filename For example:
#!/bin/sh

ab -n 100 -c 10 http://www.test.com/test1.html > test1.txt &
ab -n 100 -c 10 http://www.test2.com/test2.html  > test2.txt &


0 comments:

Post a Comment

Related Posts with Thumbnails