では、KUSANAGIは本当に速いのか。KUSANAGIのベンチマーク結果と、以前実施したWordPressチューニング環境のパフォーマンスを比べてみましょう。
まず、Webサーバの2種類「Nginx 1.11」と「Apache 2.4」、PHP処理系の2種類「HHVM 3.13」と「PHP 7.0」を組み合わせた、ページキャッシュを用いない4パターンのパフォーマンスを、1秒当たりの同時アクセス数を測定できるabコマンドで確認します。
KUSANAGI環境のミドルウェアの組み合わせを「Apache」+「PHP 7」に切り替えます。
kusanagi httpd kusanagi php7
abコマンドを実行します。次のコマンドを10秒間隔で5回実行します。間隔を空けて複数回実行するのは、ウォームアップを行い、測定の精度を高めるためです。
ab -n 300 -c 30 http://ec2-xxx.xxx.compute.amazonaws.com/
筆者の環境では、5回目の実行で次のような結果が返ってきました。
[root@ip ~]# ab -n 300 -c 30 http://ec2-xxx.xxx.compute.amazonaws.com/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking ec2- xxx.xxx.compute.amazonaws.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Finished 300 requests
Server Software: Apache
Server Hostname: ec2-xxx.xxx.compute.amazonaws.com
Server Port: 80
Document Path: /
Document Length: 11679 bytes
Concurrency Level: 30
Time taken for tests: 1.924 seconds
Complete requests: 300
Failed requests: 0
Total transferred: 3594300 bytes
HTML transferred: 3503700 bytes
Requests per second: 155.95 [#/sec] (mean)
Time per request: 192.366 [ms] (mean)
Time per request: 6.412 [ms] (mean, across all concurrent requests)
Transfer rate: 1824.68 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 1
Processing: 80 187 32.0 198 285
Waiting: 80 187 32.0 197 285
Total: 81 187 32.0 198 285
Percentage of the requests served within a certain time (ms)
50% 198
66% 201
75% 204
80% 206
90% 215
95% 219
98% 226
99% 260
100% 285 (longest request)
1秒当たりの同時アクセス数は「155.95」となりました
容易にWebサービスを高速化できるNginxを使いこなすための秘訣とは
高速・軽量・高機能……Nginxの基礎知識
WordPress自体のチューニングが必要な理由と高速化の基本的な考え方Copyright © ITmedia, Inc. All Rights Reserved.