How to Benchmark your Apache Website with siege and Apache Benchmark (ab) on Linux and FreeBSD

Friday, 25th June 2010

I’ve recently had to benchmark a website thus I decided to share a quick way on how you can achieve a generalway to benchmark your webserver configuration and your website responce times while under heavy loads.

The first and very classical way is to use ab – the Apache HTTP server benchmarking tool

To install AB (Apache Benchmark on Debian GNU/Linux it’s rather easy), invoke:

debian-server:~# apt-get install apache2-utils

On FreeBSD ab is part of the apache port so you don’t need to install anything extra to start using is.
Further on a very basic way to test your Apache performance would be:

debian-server:~# ab -n 1000 -c 100 http://yourwebsite.com

The above command would instruct apache benchmark to make 1000 connections to http://yourwebsite.com where the connection concurrency would be of 100 parallel connections
Another possible use of the Apache Benchmark tool could be for instance:

debian-server:~# ab -kc 20 -t 30 http://yourwebsite.com/

This would instruct apache benchmark to open 20 connections and keep alive the connecitons sending requests to the Webserver for 30 seconds.

Though using AB is not a bad way to make a performance measurement under a certain loads, the results in many cases won’t be completely accurate.

For a bit more accurate performance check results I advice you to check out Siege the HTTP performance stress tester

On FreeBSD – the siege webserver benchmark tool is available via the ports tree. So the install on FreeBSD is pretty straight forward with:

freebsd-box# /usr/ports/benchmarks/siege
freebsd-box# make install cleam

Luckily the siege apache stress tester has a package available for Debian Linux, so installing if you’re following this article would come to the trivial apt-get install:

debian-server:~# apt-get install siege

On other Linux / Unix platforms you would have to download the latest siege source release and compile it via the instructions in the source archive README file.

Assuming that you succeed in installing siege, next to start using it in a very simple way to check your Website of Webserver for performance as well as get some Benchmarking on how it operates under different amount of user connections you can execute something like:

debian-server:~# siege -b -c 100 -r 10 http://yourwebsite.com

This will benchmark the http://yourwebsite.com website running on top of your webserver of choice, running with 100 concurrent connections to the website, running the test in a loop 10 times.

By default all output from the siege Apache benchmarking tests would be logged in the ouput file /var/siege.log
Another handy opportunity siege provides is the ability to check a number of provided website url address via the -f option.

There possibly a number of other valuable tools to benchmark your Webserver (Apache or the webserver type you use), however I belive this twos should be enough for most benchmarkers out there.

Share this on:

Download PDFDownload PDF

Tags:

16 Responses to “How to Benchmark your Apache Website with siege and Apache Benchmark (ab) on Linux and FreeBSD”

  1. Keven Pincus says:
    Opera 9.64 Opera 9.64 Windows XP Windows XP
    Opera/9.64(Windows NT 5.1; U; en) Presto/2.1.1

    Write something, even if it’s just a suicide note.–Gore Vidal (1925- ), U.S. author

    View CommentView Comment
  2. Grisel Attard says:
    Opera 9.64 Opera 9.64 Windows XP Windows XP
    Opera/9.64(Windows NT 5.1; U; en) Presto/2.1.1

    One more fantastic post, generally awesome to study a good post over a subject you truly care about.

    View CommentView Comment
  3. Carina Gossen says:
    Opera 9.64 Opera 9.64 Windows XP Windows XP
    Opera/9.64(Windows NT 5.1; U; en) Presto/2.1.1

    Hey, possibly this is not on topic but in any case, I have been surfing around your website and it looks truly great. apparent that you know your subject matter I’m building a new blog and I am hard put to make it look great, and offer excellent subject matter. I have learned a much here and I look forward to additional updates and will be back.

    View CommentView Comment
  4. Charlotte Troiano says:
    Internet Explorer 8.0 Internet Explorer 8.0 Windows 7 x64 Edition Windows 7 x64 Edition
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; Media Center PC 6.0; InfoPath.2; MS-RTC LM 8)

    A Quite nice input . Whenever i read your blog i read a different view. In addtition , as a fresh developer, i should mention that the structure of your website is nice . Can you post the name of the theme .
    Thanks .

    View CommentView Comment
  5. Georgette Swalley says:
    Firefox 3.0.14 Firefox 3.0.14 Windows XP Windows XP
    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.14) Gecko/2009082707 Firefox/3.0.14 (.NET CLR 3.5.30729)

    It is really crazy that you posted about this. I found you on google and I had been searching for info about this. Nice website, thanks for the info.

    View CommentView Comment
  6. Elanor Porcaro says:
    Firefox 3.5.3 Firefox 3.5.3 Windows 7 Windows 7
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3

    It is cool that you blogged about this. I found you on google and I had been searching for information about this. Nice website, thanks for the info. I will return to check for new info

    View CommentView Comment
  7. Miesha Manera says:
    Opera 9.64 Opera 9.64 Windows XP Windows XP
    Opera/9.64(Windows NT 5.1; U; en) Presto/2.1.1

    I love your blog – amazing post! I first discovered your blog a week or so ago, and I bookmarked your blog the very same day. I have a few good thoughts for some upcoming posts you could write. I’ll send you an email later on. Continue the good work. 🙂

    View CommentView Comment
  8. Alease Sehgal says:
    Google Chrome 4.0.221.7 Google Chrome 4.0.221.7 Windows 7 Windows 7
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Chrome/4.0.221.7 Safari/532.2

    Feed has not been functioning in safari, Kindly remedy it.

    View CommentView Comment
  9. Lauren Herring says:
    Firefox 3.0.14 Firefox 3.0.14 Windows XP Windows XP
    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.14) Gecko/2009082707 Firefox/3.0.14 (.NET CLR 3.5.30729)

    RSS feed may not be functioning in chrome, Generously make it better.

    View CommentView Comment
  10. Eye Strain says:
    Opera 9.64 Opera 9.64 Windows XP Windows XP
    Opera/9.64(Windows NT 5.1; U; en) Presto/2.1.1

    Hello just thought I would let you know that your blog looks really messed up any time I look at it on my own iphone 3g. You may want to attempt and fix that.

    View CommentView Comment
  11. Brandi Lundblad says:
    Opera 8.50 8.50 Opera 8.50 8.50 Windows XP Windows XP
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.50

    Having been just browsing for useful blog articles intended for a project research when I happened to stumble on yours. Thanks for the helpful info!

    View CommentView Comment
  12. Keli Marinaro says:
    Internet Explorer 8.0 Internet Explorer 8.0 Windows 7 x64 Edition Windows 7 x64 Edition
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; Media Center PC 6.0; InfoPath.2; MS-RTC LM 8)

    Thanks a bunch for useful information. Keep up the great work. I’ll be returning soon.

    View CommentView Comment
  13. Renate Haessly says:
    Firefox 3.5.3 Firefox 3.5.3 Windows XP Windows XP
    Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3

    Cool. Thanks for writing this. It is always nice to see someone help out the community.

    View CommentView Comment
  14. Easter Stergios says:
    Firefox 3.5.3 Firefox 3.5.3 Windows 7 Windows 7
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3

    I intended to send you the bit of observation in order to give thanks as before considering the pleasing advice you’ve shown on this site. It’s quite strangely open-handed of you to offer freely what many individuals would’ve advertised for an electronic book in order to make some bucks on their own, principally since you might have done it if you considered necessary. Those tactics additionally worked to be the fantastic way to be sure that other people have the identical desire similar to my personal own to realize way more with reference to this condition. I’m certain there are a lot more fun sessions ahead for those who read your blog post.

    View CommentView Comment

Leave a Reply

CommentLuv badge