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

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:

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

  1. Phil Nawwar says:
    Firefox 3.5.3 Firefox 3.5.3 Windows XP Windows XP
    Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)

    The English instinctively admire any man who has no talent and is modest about it.–James Agate (1877- )

    View CommentView Comment
  2. 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
  3. PBS Documentary DVD 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

    I really loved this post. You write about this topic very well. I really like your blog and I will definetly bookmark it! Keep up the great posts! 🙂

    View CommentView Comment
  4. 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
  5. Guaranteed Radio Play says:
    Firefox 3.8 Firefox 3.8 Ubuntu 9.25 Ubuntu 9.25
    Mozilla/5.0 (X11; U; Linux i686; it-IT; rv:1.9.0.2) Gecko/2008092313 Ubuntu/9.25 (jaunty) Firefox/3.8

    Whoa, watch out i think i just found my new favorite blog|Very informative, I will def be back as i begin my next project!|Thanks, I will pass this info on to my classmates.|Good job, i must say its pretty hard to find good info on this.|Awesome post…if there were just more on the subject…I’d be a happy camper| Any other opinions on the subject?|What do you all think?|I wonder what others think about this|Honestly, I love the theme of your blog…good job|Cool theme where did you get it?| Can i bookmark this one?|Def headed off to dig this one|May i use some of this info in a powerpoint for my students at Mercy College?| Interesting…Honestlay what is your source though?| … Who would enjoy bookmarking along with me this topic for fun

    View CommentView Comment
  6. 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
  7. 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
  8. 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
  9. 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
  10. Antoinette Spoon 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

    I just like it. Great read! I only wish you updated your blog more frequently, I just can’t seem to get enough of it. I saved your site in my favorites! Would it be possible to be a guest poster sometime?

    View CommentView Comment
    • admin says:
      Epiphany 2.30.5 Epiphany 2.30.5 Debian GNU/Linux x64 Debian GNU/Linux x64
      Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/531.2+ Debian/squeeze (2.30.5-1) Epiphany/2.30.5

      Hi Antoinette,

      Hi yes being a gues poster is perfectly fine

      Regards,
      Georgi

      View CommentView Comment
  11. 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
  12. 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
  13. 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
  14. Cyncfoolo says:
    Internet Explorer 5.5 Internet Explorer 5.5 Windows NT 4.0 Windows NT 4.0
    Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0; .NET CLR 1.0.2914)

    Hey Blogger,When you write some blogs and share with us,that is a hard work for you but share makes you
    happly right?
    good luck and cheers!

    View CommentView Comment
  15. 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
  16. Natasha Staiano 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

    Pretty insightful post. Never thought that it was this simple after all. I had spent a good deal of my time looking for someone to explain this subject clearly and you’re the only one that ever did that. Kudos to you! Keep it up

    View CommentView Comment
  17. 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
  18. 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
  19. 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
  20. Willodean Stropko says:
    Nokia Web Browser Nokia Web Browser Nokia 6220 Nokia 6220
    Nokia6220/2.0 (pA3.02) Profile/MIDP-2.0 Configuration/CLDC-1.1

    Hey this is a cool post. I was just wondering if I can quote a bit of it on my own site? I would definitely link back to it so my readers could see the full thing on your blog. Please let me know if that’s alright with you. Thank you either way. 🙂

    View CommentView Comment
  21. 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
  22. MBT says:
    Internet Explorer 8.0 Internet Explorer 8.0 Windows XP Windows XP
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)

    good news.

    View CommentView Comment

Leave a Reply

CommentLuv badge