$ /usr/local/apache/bin/ab -c 10 -n 1000 http://localhost/info.php
This command tests the speed of the PHP script
info.php 1,000 times, with 10 concurrent
requests running at any given time. The benchmarking tool returns
various information about the test, including the slowest, fastest,
and average load times. You can compare those values to a static HTML
page to see how quickly your script performs.
For example, here's the output from 1,000 fetches of
a page that simply calls phpinfo( ):
This is ApacheBench, Version 1.3d <$Revision: 1.4 $> apache-1.3
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd,
http://www.zeustech.net/
Copyright (c) 1998-2001 The Apache Group, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests
Server Software: Apache/1.3.22
Server Hostname: localhost
Server Port: 80
Document Path: /info.php
Document Length: 49414 bytes
Concurrency Level: 10
Time taken for tests: 8.198 seconds
Complete requests: 1000
Failed requests: 0
Broken pipe errors: 0
Total transferred: 49900378 bytes
HTML transferred: 49679845 bytes
Requests per second: 121.98 [#/sec] (mean)
Time per request: 81.98 [ms] (mean)
Time per request: 8.20 [ms] (mean, across all concurrent requests)
Transfer rate: 6086.90 [Kbytes/sec] received
Connnection Times (ms)
min mean[+/-sd] median max
Connect: 0 12 16.9 1 72
Processing: 7 69 68.5 58 596
Waiting: 0 64 69.4 50 596
Total: 7 81 66.5 79 596
Percentage of the requests served within a certain time (ms)
50% 79
66% 80
75% 83
80% 84
90% 158
95% 221
98% 268
99% 288
100% 596 (last request)