という記事に
CODE:
-
BufferedLogs On
によるアクセスログのバッファリングの記事がありました。試したことのないディレクティブだったので、実験してみました。
環境は
- CentOS5
- Apache/2.2.4
で、貧弱なサーバーです。
チェック方法
CODE:
-
/usr/local/apache2/bin/ab -n 10000 -c 100 http://stockholm/
1回実行後に2回さらに実行して、後半2回の平均を取る
設定1)バッファリングなしで、cronlogなし
※CustomLog logs/access_log combined
CODE:
-
Server Software: Apache/2.2.4
-
Server Hostname: stockholm
-
Server Port: 80
-
-
Document Path: /
-
Document Length: 44 bytes
-
-
Concurrency Level: 100
-
Time taken for tests: 11.973132 seconds
-
Complete requests: 10000
-
Failed requests: 0
-
Write errors: 0
-
Total transferred: 2909570 bytes
-
HTML transferred: 441452 bytes
-
Requests per second: 835.20 [#/sec] (mean)
-
Time per request: 119.731 [ms] (mean)
-
Time per request: 1.197 [ms] (mean, across all concurrent requests)
-
Transfer rate: 237.28 [Kbytes/sec] received
-
-
Connection Times (ms)
-
min mean[+/-sd] median max
-
Connect: 0 12 11.3 10 74
-
Processing: 20 105 16.5 105 482
-
Waiting: 9 73 26.5 74 461
-
Total: 23 118 19.6 117 493
-
-
Percentage of the requests served within a certain time (ms)
-
50% 117
-
66% 122
-
75% 126
-
80% 128
-
90% 137
-
95% 145
-
98% 155
-
99% 161
-
100% 493 (longest request)
-
-
Server Software: Apache/2.2.4
-
Server Hostname: stockholm
-
Server Port: 80
-
-
Document Path: /
-
Document Length: 44 bytes
-
-
Concurrency Level: 100
-
Time taken for tests: 12.232209 seconds
-
Complete requests: 10000
-
Failed requests: 0
-
Write errors: 0
-
Total transferred: 2900000 bytes
-
HTML transferred: 440000 bytes
-
Requests per second: 817.51 [#/sec] (mean)
-
Time per request: 122.322 [ms] (mean)
-
Time per request: 1.223 [ms] (mean, across all concurrent requests)
-
Transfer rate: 231.52 [Kbytes/sec] received
-
-
Connection Times (ms)
-
min mean[+/-sd] median max
-
Connect: 0 0 2.1 0 28
-
Processing: 15 120 237.3 115 12182
-
Waiting: 14 120 237.3 115 12181
-
Total: 15 120 237.4 115 12182
-
-
Percentage of the requests served within a certain time (ms)
-
50% 115
-
66% 115
-
75% 116
-
80% 116
-
90% 120
-
95% 128
-
98% 142
-
99% 150
-
100% 12182 (longest request)
Requests per second: 826.355 (平均)
設定2)バッファリングなしで、cronlogあり
※CustomLog "|/usr/local/sbin/cronolog /usr/local/apache2/logs/access_log.%Y-%m-%d" combined
CODE:
-
Server Software: Apache/2.2.4
-
Server Hostname: stockholm
-
Server Port: 80
-
-
Document Path: /
-
Document Length: 44 bytes
-
-
Concurrency Level: 100
-
Time taken for tests: 12.177233 seconds
-
Complete requests: 10000
-
Failed requests: 0
-
Write errors: 0
-
Total transferred: 2900000 bytes
-
HTML transferred: 440000 bytes
-
Requests per second: 821.20 [#/sec] (mean)
-
Time per request: 121.772 [ms] (mean)
-
Time per request: 1.218 [ms] (mean, across all concurrent requests)
-
Transfer rate: 232.57 [Kbytes/sec] received
-
-
Connection Times (ms)
-
min mean[+/-sd] median max
-
Connect: 0 0 1.7 0 29
-
Processing: 18 120 80.6 113 3127
-
Waiting: 17 117 61.1 112 2298
-
Total: 18 120 80.6 113 3127
-
-
Percentage of the requests served within a certain time (ms)
-
50% 113
-
66% 114
-
75% 115
-
80% 115
-
90% 116
-
95% 118
-
98% 149
-
99% 558
-
100% 3127 (longest request)
-
-
Server Software: Apache/2.2.4
-
Server Hostname: stockholm
-
Server Port: 80
-
-
Document Path: /
-
Document Length: 44 bytes
-
-
Concurrency Level: 100
-
Time taken for tests: 12.72722 seconds
-
Complete requests: 10000
-
Failed requests: 0
-
Write errors: 0
-
Total transferred: 2900000 bytes
-
HTML transferred: 440000 bytes
-
Requests per second: 828.31 [#/sec] (mean)
-
Time per request: 120.727 [ms] (mean)
-
Time per request: 1.207 [ms] (mean, across all concurrent requests)
-
Transfer rate: 234.58 [Kbytes/sec] received
-
-
Connection Times (ms)
-
min mean[+/-sd] median max
-
Connect: 0 0 1.6 0 28
-
Processing: 1 119 1051.5 3 11423
-
Waiting: 0 17 131.2 3 8634
-
Total: 1 119 1051.5 3 11423
-
-
Percentage of the requests served within a certain time (ms)
-
50% 3
-
66% 4
-
75% 6
-
80% 7
-
90% 8
-
95% 113
-
98% 654
-
99% 1101
-
100% 11423 (longest request)
Requests per second: 824.755 (平均)
設定3)バッファリングありで、cronlogあり
※CustomLog "|/usr/local/sbin/cronolog /usr/local/apache2/logs/access_log.%Y-%m-%d" combined
CODE:
-
Server Software: Apache/2.2.4
-
Server Hostname: stockholm
-
Server Port: 80
-
-
Document Path: /
-
Document Length: 44 bytes
-
-
Concurrency Level: 100
-
Time taken for tests: 11.347721 seconds
-
Complete requests: 10000
-
Failed requests: 0
-
Write errors: 0
-
Total transferred: 2909280 bytes
-
HTML transferred: 441408 bytes
-
Requests per second: 881.23 [#/sec] (mean)
-
Time per request: 113.477 [ms] (mean)
-
Time per request: 1.135 [ms] (mean, across all concurrent requests)
-
Transfer rate: 250.36 [Kbytes/sec] received
-
-
Connection Times (ms)
-
min mean[+/-sd] median max
-
Connect: 0 11 10.7 8 70
-
Processing: 18 100 16.8 100 457
-
Waiting: 9 71 26.0 79 406
-
Total: 18 111 20.6 110 476
-
-
Percentage of the requests served within a certain time (ms)
-
50% 110
-
66% 115
-
75% 119
-
80% 122
-
90% 132
-
95% 141
-
98% 151
-
99% 157
-
100% 476 (longest request)
-
-
Server Software: Apache/2.2.4
-
Server Hostname: stockholm
-
Server Port: 80
-
-
Document Path: /
-
Document Length: 44 bytes
-
-
Concurrency Level: 100
-
Time taken for tests: 11.505531 seconds
-
Complete requests: 10000
-
Failed requests: 0
-
Write errors: 0
-
Total transferred: 2900000 bytes
-
HTML transferred: 440000 bytes
-
Requests per second: 869.15 [#/sec] (mean)
-
Time per request: 115.055 [ms] (mean)
-
Time per request: 1.151 [ms] (mean, across all concurrent requests)
-
Transfer rate: 246.14 [Kbytes/sec] received
-
-
Connection Times (ms)
-
min mean[+/-sd] median max
-
Connect: 0 35 27.7 32 107
-
Processing: 26 78 17.8 75 131
-
Waiting: 1 40 24.2 37 110
-
Total: 27 113 16.0 114 212
-
-
Percentage of the requests served within a certain time (ms)
-
50% 114
-
66% 120
-
75% 124
-
80% 127
-
90% 134
-
95% 140
-
98% 144
-
99% 146
Requests per second: 875.19 (平均)
やはり5-6%はあきらかに効果があるようです。
静的コンテンツ用のサーバーの場合は使える設定だと思います。
ちなみに
設定4)アクセスログの出力自体を停止
の場合は
Requests per second: 902.15 (平均)
なのでバッファリングした時と比べると1%くらいしか性能向上しませんでした。




