wp-cronを止めることでどれほど早くなるのか
前回でwp-cronの停止と、代替にcronへの登録を行いました
前回の記事はコチラ
今回はこちらを入れ込み、apachebenchにて速度のテストを行います。
速度テストはすべて、
ab -n 500 -c 10 http://hogehoge/
アクセス回数が500、同時接続数10で検証してみたいと思います。
ケース1。デフォルトの状態。
まずは、WordPressを入れた直後、(wordpressバージョン4.9.6)で検証。
[wp-cron 無効前]
Server Software: Apache
Server Hostname: 172.30.2.74
Server Port: 80
Document Path: /
Document Length: 56495 bytes
Concurrency Level: 10
Time taken for tests: 12.138 seconds
Complete requests: 500
Failed requests: 0
Total transferred: 28397500 bytes
HTML transferred: 28247500 bytes
Requests per second: 41.19 [#/sec] (mean)
Time per request: 242.754 [ms] (mean)
Time per request: 24.275 [ms] (mean, across all concurrent requests)
Transfer rate: 2284.78 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 94 224 44.1 222 1130
Waiting: 92 157 46.8 154 1024
Total: 94 224 44.1 222 1130
Percentage of the requests served within a certain time (ms)
50% 222
66% 226
75% 229
80% 232
90% 239
95% 248
98% 260
99% 278
100% 1130 (longest request)
[wp-cron 無効後]
Server Software: Apache
Server Hostname: 172.30.2.74
Server Port: 80
Document Path: /
Document Length: 56495 bytes
Concurrency Level: 10
Time taken for tests: 11.234 seconds
Complete requests: 500
Failed requests: 0
Total transferred: 28397500 bytes
HTML transferred: 28247500 bytes
Requests per second: 44.51 [#/sec] (mean)
Time per request: 224.686 [ms] (mean)
Time per request: 22.469 [ms] (mean, across all concurrent requests)
Transfer rate: 2468.51 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 51 224 19.9 224 327
Waiting: 21 165 20.8 163 251
Total: 51 224 19.9 224 327
Percentage of the requests served within a certain time (ms)
50% 224
66% 226
75% 228
80% 232
90% 240
95% 249
98% 264
99% 288
100% 327 (longest request)
データがなにやらたくさんありますが、ここではRequests per second(1秒間にリクエストをどれだけ捌けるか)を見ていこうと思います。
このデータだと、41.19 [#/sec] (mean)から44.51 [#/sec] (mean)へ上がっていることがわかります。
3.32差なので、10%までは行かないまでも結構な増加が見込めますね。
ケース2。プラグインを多く入れている場合
WordPressを使っている人は、たくさんの便利なプラグインを入れていると思います。
入れてみて使わなかった場合にはOFFにしているから平気だぜ!とか思っているかもしれませんが、OFFにしていても、wp-cronで更新のチェックは働いてます。
もしかしたら使うかもしれないから残しておいても、今は使ってもいないプラグインの更新を毎回確認するなんて無駄ですよね。
そんな方が入れたらどんな結果になるかがこちらです。今回はプラグインを40個入れてみました。
[wp-cron 無効前]
Server Software: Apache
Server Hostname: 172.30.2.74
Server Port: 80
Document Path: /
Document Length: 56495 bytes
Concurrency Level: 10
Time taken for tests: 12.686 seconds
Complete requests: 500
Failed requests: 0
Total transferred: 28397500 bytes
HTML transferred: 28247500 bytes
Requests per second: 39.41 [#/sec] (mean)
Time per request: 253.717 [ms] (mean)
Time per request: 25.372 [ms] (mean, across all concurrent requests)
Transfer rate: 2186.05 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 92 235 44.6 233 1135
Waiting: 80 176 45.9 179 1025
Total: 92 235 44.6 234 1136
Percentage of the requests served within a certain time (ms)
50% 234
66% 236
75% 241
80% 245
90% 250
95% 259
98% 274
99% 280
100% 1136 (longest request)
[wp-cron 無効後]
Server Software: Apache
Server Hostname: 172.30.2.74
Server Port: 80
Document Path: /
Document Length: 56495 bytes
Concurrency Level: 10
Time taken for tests: 11.419 seconds
Complete requests: 500
Failed requests: 0
Total transferred: 28397500 bytes
HTML transferred: 28247500 bytes
Requests per second: 43.79 [#/sec] (mean)
Time per request: 228.375 [ms] (mean)
Time per request: 22.838 [ms] (mean, across all concurrent requests)
Transfer rate: 2428.63 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 72 227 19.8 228 340
Waiting: 22 164 26.8 165 254
Total: 72 227 19.8 228 340
Percentage of the requests served within a certain time (ms)
50% 228
66% 230
75% 234
80% 239
90% 245
95% 255
98% 271
99% 281
100% 340 (longest request)
コチラの結果は39.41 [#/sec] (mean)から43.79 [#/sec] (mean)へ
4.38差ですので差分が大きくなっていることがわかります。
もちろんこれはプラグインをインストールだけして、有効化はしていません。
OFFにしていようが、処理を食うのです。設定が面倒ならばここで簡単に試せますよ。
プラグインをたくさん入れている方は是非ご検討を。


