14.3. Benchmarking

What matters in the end is how your site performs overall. An effective way of testing designs and detecting bottlenecks is to benchmark your site by simulating production traffic.

This section briefly introduces two tools for site benchmarking: ApacheBench and Siege.

14.3.1. Using ApacheBench

One benchmarking tool is ab (which stands for Apache Benchmarking tool) which is bundled with the Apache web server and is most likely installed on your system already if you are running Apache. ab works by simulating a number of clients sending requests to your web server with a specified delay, hammering away on the same URL.

Here's an example:

$ ab -n 10000 -c 10 http://localhost/test.php

The –n option specifies the number of requests, ...

Get PHP 5 Power Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.