xcache, boost, and mod-evasive benchmarking

A log of my work benchmarking the FSP website, after the HCR6 Jeffersonian Principles meltdown.

2009-03-01
Louis went and installed Drupal's Boost module, so I reran the benchmarks.

Adding Boost doubled the pages/sec and offloaded everything.

2009-02-19
Installing bash-completion

    sudo apt-get install bash-completion
Installing apachetop
    sudo aptitude install apachetop

At first I installed memcache, but before enabling it I noticed php-xcache was already installed.  Good enough.  So I proceeded to benchmark the two main config options in xcache.ini:  xcache.size and xcache.var_size.

Tests were run via Apache.org's ab command.   Full output of the test runs make for the bulk of this page.

It was quickly evident that mod_evasive was doing it's job well and blocking the benchmark program as a potential denial-of-service attack.  I finished the tests, and the re-ran them with mod_evasive disabled.  I re-enabled mod-evasive after testing.

Finding:

Just having xcache seems to be enough, and tweaking the two variables netted no real gain with higher mem usage.  I reverted both variable back to 64M.

I would seriously consider benchmarking drupal's boot module:
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/boost/README.txt?view=markup&pathrev=DRUPAL-6--1

The rest of this page is the raw data from apache benchmark.

site xcache evasive p/sec time failed
forum 64 on 11.35 88.1 73
forum 128 on 7.84 127.6 99
forum 64 off 9.8 101.3 0
forum 128 off 9.7 103.1 291



site xcache evasive boost
p/sec time failed
fsp 64 on  off 37.63 26.5 679
fsp 128 on  off 42.06 23.7 874
fsp 64 off  off 18.8 52.9 0
fsp 128 off  off 21.17 47.2 0
fsp
 64  off  on 73.49 13.6 0

Setting xcache's variable memsize to 128M

site vcache evasive p/sec time failed
forum 128 off 10.18 98.1 0
fsp 128 off 20.10 49.7 0




(xcache 64M & mod_evasive) forum.freestateproject.org

[dan@http ~]$ ab -n 1000 -c 5 http://forum.freestateproject.org/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking forum.freestateproject.org (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/2.2.8
Server Hostname:        forum.freestateproject.org
Server Port:            80
Document Path:          /
Document Length:        57033 bytes
Concurrency Level:      5
Time taken for tests:   88.118604 seconds
Complete requests:      1000
Failed requests:        73
(Connect: 0, Length: 73, Exceptions: 0)
Write errors:           0
Non-2xx responses:      73
Total transferred:      53324782 bytes
HTML transferred:       52896017 bytes
Requests per second:    11.35 [#/sec] (mean)
Time per request:       440.593 [ms] (mean)
Time per request:       88.119 [ms] (mean, across all concurrent requests)
Transfer rate:          590.95 [Kbytes/sec] received
Connection Times (ms)
min  mean[+/-sd] median   max
Connect:       37   53 189.6     39    3053
Processing:    39  378 458.6    328    5486
Waiting:       38  192 449.0    135    5309
Total:         77  431 496.3    369    5525
Percentage of the requests served within a certain time (ms)
50%    369
66%    400
75%    426
80%    446
90%    519
95%    617
98%    793
99%   3396
100%   5525 (longest request)


(xcache 64M && mod-evasive) freestateproject.org

[dan@http ~]$ ab -n 1000 -c 5 http://freestateproject.org/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking freestateproject.org (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/2.2.8
Server Hostname:        freestateproject.org
Server Port:            80
Document Path:          /
Document Length:        25371 bytes
Concurrency Level:      5
Time taken for tests:   26.575723 seconds
Complete requests:      1000
Failed requests:        679
(Connect: 0, Length: 679, Exceptions: 0)
Write errors:           0
Non-2xx responses:      679
Total transferred:      8754874 bytes
HTML transferred:       8402049 bytes
Requests per second:    37.63 [#/sec] (mean)
Time per request:       132.879 [ms] (mean)
Time per request:       26.576 [ms] (mean, across all concurrent requests)
Transfer rate:          321.68 [Kbytes/sec] received
Connection Times (ms)
min  mean[+/-sd] median   max
Connect:       33   38   2.7     38      70
Processing:    28   92 182.2     42    3192
Waiting:       27   64 169.9     41    3072
Total:         66  131 182.2     81    3230
Percentage of the requests served within a certain time (ms)
50%     81
66%    120
75%    177
80%    185
90%    196
95%    218
98%    305
99%    457
100%   3230 (longest request)


Setting Xcache from 64M to 128M

(xcache 128M & mod-evasive) forum.freestateproject.org

[dan@http ~]$ ab -n 1000 -c 5 http://forum.freestateproject.org/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking forum.freestateproject.org (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/2.2.8
Server Hostname:        forum.freestateproject.org
Server Port:            80
Document Path:          /
Document Length:        57038 bytes
Concurrency Level:      5
Time taken for tests:   127.609176 seconds
Complete requests:      1000
Failed requests:        99
(Connect: 0, Length: 99, Exceptions: 0)
Write errors:           0
Non-2xx responses:      18
Total transferred:      56458213 bytes
HTML transferred:       56018723 bytes
Requests per second:    7.84 [#/sec] (mean)
Time per request:       638.046 [ms] (mean)
Time per request:       127.609 [ms] (mean, across all concurrent requests)
Transfer rate:          432.05 [Kbytes/sec] received
Connection Times (ms)
min  mean[+/-sd] median   max
Connect:       32   56 212.2     39    3061
Processing:    40  570 773.4    429   11419
Waiting:       39  304 758.4    164   11136
Total:         77  626 800.8    470   11457
Percentage of the requests served within a certain time (ms)
50%    470
66%    525
75%    592
80%    632
90%    769
95%    924
98%   3489
99%   5502
100%  11457 (longest request)


(xcache 128M & mod-evasive) freestateproject.org

[dan@http ~]$ ab -n 1000 -c 5 http://freestateproject.org/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking freestateproject.org (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/2.2.8
Server Hostname:        freestateproject.org
Server Port:            80
Document Path:          /
Document Length:        25371 bytes
Concurrency Level:      5
Time taken for tests:   23.775399 seconds
Complete requests:      1000
Failed requests:        874
(Connect: 0, Length: 874, Exceptions: 0)
Write errors:           0
Non-2xx responses:      874
Total transferred:      3796588 bytes
HTML transferred:       3507890 bytes
Requests per second:    42.06 [#/sec] (mean)
Time per request:       118.877 [ms] (mean)
Time per request:       23.775 [ms] (mean, across all concurrent requests)
Transfer rate:          155.92 [Kbytes/sec] received
Connection Times (ms)
min  mean[+/-sd] median   max
Connect:       37   45 134.1     38    3039
Processing:    32   71 163.1     41    3624
Waiting:       31   54 149.0     40    3502
Total:         70  117 210.4     80    3662
Percentage of the requests served within a certain time (ms)
50%     80
66%     82
75%     86
80%     90
90%    222
95%    241
98%    314
99%    441
100%   3662 (longest request)


Disabling mod-evasive and setting xcache back to 64M

(xcache 64M) forum.freestateproject.org

[dan@http ~]$ ab -n 1000 -c 5 http://forum.freestateproject.org/ 
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking forum.freestateproject.org (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/2.2.8
Server Hostname:        forum.freestateproject.org
Server Port:            80
Document Path:          /
Document Length:        57052 bytes
Concurrency Level:      5
Time taken for tests:   101.326596 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      57542784 bytes
HTML transferred:       57099341 bytes
Requests per second:    9.87 [#/sec] (mean)
Time per request:       506.633 [ms] (mean)
Time per request:       101.327 [ms] (mean, across all concurrent requests)
Transfer rate:          554.58 [Kbytes/sec] received
Connection Times (ms)
    min mean[+/-sd] median max
Connect: 33 62 250.3 39 3048 Processing: 259 442 307.8 407 5432 Waiting: 85 192 304.7 144 5169 Total: 298 505 400.1 448 5471 Percentage of the requests served within a certain time (ms)
    50% 448 66% 477 75% 504 80% 528 90% 603 95% 706 98% 940 99% 3429
    100% 5471 (longest request)


(xcache 64M) freestateproject.org

[dan@http ~]$ ab -n 1000 -c 5 http://freestateproject.org/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking freestateproject.org (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/2.2.8
Server Hostname:        freestateproject.org
Server Port:            80
Document Path:          /
Document Length:        25371 bytes
Concurrency Level:      5
Time taken for tests:   52.991944 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      25942000 bytes
HTML transferred:       25371000 bytes
Requests per second:    18.87 [#/sec] (mean)
Time per request:       264.960 [ms] (mean)
Time per request:       52.992 [ms] (mean, across all concurrent requests)
Transfer rate:          478.05 [Kbytes/sec] received
Connection Times (ms)
min  mean[+/-sd] median   max
Connect:       31   44 134.1     38    3039
Processing:   168  208 238.2    184    4573
Waiting:       49   83 237.3     61    4451
Total:        206  253 273.3    223    4612
Percentage of the requests served within a certain time (ms)
50%    223
66%    227
75%    230
80%    232
90%    245
95%    271
98%    441
99%    581
100%   4612 (longest request)


Upping xcache to 128M and no mod-evasive

(xcache 128M) forum.freestateproject.org

[dan@http ~]$ ab -n 1000 -c 5 http://forum.freestateproject.org/                This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking forum.freestateproject.org (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/2.2.8
Server Hostname:        forum.freestateproject.org
Server Port:            80
Document Path:          /
Document Length:        56504 bytes
Concurrency Level:      5
Time taken for tests:   103.117324 seconds
Complete requests:      1000
Failed requests:        291
(Connect: 0, Length: 291, Exceptions: 0)
Write errors:           0
Total transferred:      56969453 bytes
HTML transferred:       56526010 bytes
Requests per second:    9.70 [#/sec] (mean)
Time per request:       515.587 [ms] (mean)
Time per request:       103.117 [ms] (mean, across all concurrent requests)
Transfer rate:          539.52 [Kbytes/sec] received
Connection Times (ms)
min  mean[+/-sd] median   max
Connect:       37   58 211.8     39    3043
Processing:   250  454 411.3    404    5616
Waiting:       83  232 404.6    174    5437
Total:        289  513 461.5    448    5654
Percentage of the requests served within a certain time (ms)
50%    448
66%    485
75%    515
80%    539
90%    618
95%    757
98%   1058
99%   3365
100%   5654 (longest request)


(xcache 128M) freestateproject.org

[dan@http ~]$ ab -n 1000 -c 5 http://freestateproject.org/ 
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking freestateproject.org (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/2.2.8
Server Hostname:        freestateproject.org
Server Port:            80
Document Path:          /
Document Length:        25371 bytes
Concurrency Level:      5
Time taken for tests:   47.226505 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      25963720 bytes
HTML transferred:       25392149 bytes
Requests per second:    21.17 [#/sec] (mean)
Time per request:       236.133 [ms] (mean)
Time per request:       47.227 [ms] (mean, across all concurrent requests)
Transfer rate:          536.88 [Kbytes/sec] received
Connection Times (ms)
min  mean[+/-sd] median   max
Connect:       33   44 134.2     38    3041
Processing:   132  189  99.9    185    3191
Waiting:       50   69  97.6     64    3067
Total:        172  234 167.0    224    3231
Percentage of the requests served within a certain time (ms)
50%    224
66%    227
75%    229
80%    231
90%    239
95%    258
98%    328
99%    441
100%   3231 (longest request)


sett xcache variable memory ( result caching ) to 128M

( varcache 128 ) forum.freestateproject.org

[dan@http ~]$ ab -n 1000 -c 5 http://forum.freestateproject.org/ 
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking forum.freestateproject.org (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/2.2.8
Server Hostname:        forum.freestateproject.org
Server Port:            80
Document Path:          /
Document Length:        56194 bytes
Concurrency Level:      5
Time taken for tests:   98.189031 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      56637000 bytes
HTML transferred:       56194000 bytes
Requests per second:    10.18 [#/sec] (mean)
Time per request:       490.945 [ms] (mean)
Time per request:       98.189 [ms] (mean, across all concurrent requests)
Transfer rate:          563.29 [Kbytes/sec] received
Connection Times (ms)
min  mean[+/-sd] median   max
Connect:       37   39   4.0     39      86
Processing:   363  437 299.4    403    5600
Waiting:       83  146 295.1    116    5199
Total:        402  476 299.5    442    5638
Percentage of the requests served within a certain time (ms)
50%    442
66%    456
75%    468
80%    478
90%    510
95%    559
98%    680
99%    767
100%   5638 (longest request)

( vcache 128M ) freestateproject.org

[dan@http ~]$ ab -n 1000 -c 5 http://freestateproject.org/ 
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking freestateproject.org (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/2.2.8
Server Hostname:        freestateproject.org
Server Port:            80
Document Path:          /
Document Length:        25371 bytes
Concurrency Level:      5
Time taken for tests:   49.745438 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      25942000 bytes
HTML transferred:       25371000 bytes
Requests per second:    20.10 [#/sec] (mean)
Time per request:       248.727 [ms] (mean)
Time per request:       49.745 [ms] (mean, across all concurrent requests)
Transfer rate:          509.25 [Kbytes/sec] received
Connection Times (ms)
min  mean[+/-sd] median   max
Connect:       34   48 164.2     39    3044
Processing:   171  199 100.3    185    1568
Waiting:       48   74  98.2     62    1447
Total:        209  247 191.9    224    3229
Percentage of the requests served within a certain time (ms)
50%    224
66%    228
75%    231
80%    236
90%    254
95%    291
98%    390
99%    572
100%   3229 (longest request) 

Drupal's Boost static page caching module

(Boost on) freestateproject.org


Fist, disable mod-evasive:
  • sudo /usr/sbin/a2dismod mod-evasive
  • sudo service apache2 force-reload
[dan@http benchmark]$ ab -n 1000 -c 5 http://freestateproject.org/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking freestateproject.org (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/2.2.8
Server Hostname:        freestateproject.org
Server Port:            80
Document Path:          /
Document Length:        394 bytes
Concurrency Level:      5
Time taken for tests:   13.607306 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Non-2xx responses:      1000
Total transferred:      760000 bytes
HTML transferred:       394000 bytes
Requests per second:    73.49 [#/sec] (mean)
Time per request:       68.037 [ms] (mean)
Time per request:       13.607 [ms] (mean, across all concurrent requests)
Transfer rate:          54.53 [Kbytes/sec] received
Connection Times (ms)
min  mean[+/-sd] median   max
Connect:       27   31   1.5     32      43
Processing:    32   35  12.3     34     311
Waiting:       31   33   2.5     33      65
Total:         63   66  12.4     66     342
Percentage of the requests served within a certain time (ms)
50%     66
66%     66
75%     67
80%     67
90%     68
95%     71
98%     75
99%     81
100%    342 (longest request)