Stress Testing Web Applications in Apache

14 September, 2007 (13:59) | PHP

I’ve just done some testing on my web application in Apache, and it needs some work :) I knew it would, but it is proven to me now :)

# ab2 -k -c 50 -t 300 http://devwww.(hidden).net/user/1/
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.121.2.12 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/

Benchmarking devwww.(hidden).net (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Finished 24371 requests

Server Software:        Apache
Server Hostname:        devwww.(hidden).net
Server Port:            80

Document Path:          /user/1/
Document Length:        16332 bytes

Concurrency Level:      50
Time taken for tests:   300.22405 seconds
Complete requests:      24371
Failed requests:        13757
   (Connect: 0, Length: 13757, Exceptions: 0)
Write errors:           0
Keep-Alive requests:    13638
Total transferred:      210569714 bytes
HTML transferred:       203901156 bytes
Requests per second:    81.23 [#/sec] (mean)
Time per request:       615.532 [ms] (mean)
Time per request:       12.311 [ms] (mean, across all concurrent requests)
Transfer rate:          685.40 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   1.0      0      49
Processing:     7  614 436.0    546    9047
Waiting:        7  435 395.7    311    8677
Total:          7  614 436.1    546    9047

Percentage of the requests served within a certain time (ms)
  50%    546
  66%    686
  75%    788
  80%    858
  90%   1059
  95%   1301
  98%   1781
  99%   2307
 100%   9047 (longest request)

Now I need to look into some caching of dynamic pages and database results, and some other things :)