HowTo.Gumph.Org

Step by step solutions to IT problems

Measure your Websites Performance

If you've ever wanted to know how many users your webserver can handle, or if it could survive a slashdotting then you need to accurately measure how many complete pages it can deliver a second.

The number of users your website can handle depends on lots of issues

  • the hardware your webserver is running
  • whether your serving static or dynamic (asp,jsp,php etc) pages
  • is your webserver also running your websites database (e.g. mySql)
  • the size of your webservers internet connection

Knowing how many pages your webserver can serve every second will enable you to better understand where your sites bottleneck is likely to be. If you have a database intensive dynamic pages and can only serve a handful of pages a second, then paying for a fat internet pipe is wasted money as your webserver will never manage to fill it.

Whereas if most of your site is static html, then the bottleneck is likely to either be the size of your internet connection or the amount of memory your webserver has (depends largely on your choice of webserver software).

By stress testing your webserver, before your users do it for you, will enable you to not only have a good idea of how it performs, but you will also be able to monitor the memory and CPU usage of the webserver while testing it, so you can decide if the server or bandwith needs upgrading, or if you need to tune your web site or create a webserver cluster to handle the load.

If your website is running on webspace provided by an 3rd party hosting firm, then please remember that they are very unlikely to appreciate you stress testing their servers. Only test your own servers.

Download a testing tool

A simple webserver testing tool is Microsoft's free Web Application Stress Tool. It's only a 9.5MB download.

Once downloaded run the setup.exe to install it, no reboot needed!

Your first test

How the web testing tool works, is it (or you) creates a script denoting what to test, then you run the test, and it shows you very detailed results.

The first time you run it, it presents you with a wizard to choose how you want to create the first test script.

The easiest method (unless your website is very large) is just to record a sample browsing session, and then use that as the basis for the test. If you are running multiple websites on a single webserver (virtual hosting) which is almost always the case, then tick the record the host header box.

Your browser will be opened automatically when you click on the finish button.

Once your browser opens, simple type in the address of your website, and surf around the site as a normal user would (or visit the specific pages you want to really test), then minimize the browser and click the Stop Recording button on the stress tool

Now check that the webserver listed is the correct one (it seems to default to localhost)

then click on the play button on the toolbar to run the test, and wait while it runs.

Viewing the results

Once the test has finished, select View -> Reports from the menu to see the results of your test.

The most interesting figure is of course the requests per second, but the report provides much more detail, more than I can go into here.

There are quite a lot of other website testing tools out there, some of which are better, some worse than this one, but they all enable you to find out quite simply just how many pages your webserver can manage to serve a second, and whether any pages are taking too long, or too many resources.

Submit to     del.icio.us    digg    reddit    simpy