php7.1(最新)にバージョンアップ後のApache Benchでのベンチマーク検証
先週に大規模なバージョンアップを行いその前後でのApacheBenchを用いた検証結果を紹介したいと思います。
まず始めに、前回バージョンアップ前のサーバ
mysql5.5.44とphp5.5、apacheのconfなどの設定は、こちらに示してある状態です。
[root@www16071ue conf]# ab -c 15 -n 100 http://www.tkweblife.com/wordpress/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking www16071ue.sakura.ne.jp (be patient).....done
Server Software:        Apache
Server Hostname:        www16071ue.sakura.ne.jp
Server Port:            80
Document Path:          /wordpress/
Document Length:        83816 bytes
Concurrency Level:      15
Time taken for tests:   66.242 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      8403200 bytes
HTML transferred:       8381600 bytes
Requests per second:    1.51 [#/sec] (mean)
Time per request:       9936.334 [ms] (mean)
Time per request:       662.422 [ms] (mean, across all concurrent requests)
Transfer rate:          123.88 [Kbytes/sec] received
Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.2      0       1
Processing:  2714 9551 1657.5   9505   13544
Waiting:      625 4944 1210.6   4684    8562
Total:       2714 9551 1657.5   9505   13544
Percentage of the requests served within a certain time (ms)
  50%   9505
  66%   9909
  75%  10296
  80%  10654
  90%  11514
  95%  12214
  98%  13368
  99%  13544
 100%  13544 (longest request)
大体、50%で約9.5秒、約100%で13秒前後となっています。
ここまでの負荷状態には、当然なりませんがそこそこの状況です。
そしてmysql5.7,php7.1へバージョンアップ後のapache benchの結果です。
[root@www16071ue]# ab -c 15 -n 100 http://www.tkweblife.com/wordpress/ This is ApacheBench, Version 2.3 <$Revision: 655654 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking www16071ue.sakura.ne.jp (be patient).....done Server Software: Apache Server Hostname: www16071ue.sakura.ne.jp Server Port: 80 Document Path: /wordpress/ Document Length: 238151 bytes Concurrency Level: 15 Time taken for tests: 44.333 seconds Complete requests: 100 Failed requests: 0 Write errors: 0 Total transferred: 23836700 bytes HTML transferred: 23815100 bytes Requests per second: 2.26 [#/sec] (mean) Time per request: 6649.875 [ms] (mean) Time per request: 443.325 [ms] (mean, across all concurrent requests) Transfer rate: 525.08 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.1 0 1 Processing: 2933 6358 1262.2 6374 9417 Waiting: 384 3661 1190.5 3524 6625 Total: 2933 6358 1262.1 6374 9417 Percentage of the requests served within a certain time (ms) 50% 6374 66% 6972 75% 7383 80% 7607 90% 8012 95% 8256 98% 9311 99% 9417 100% 9417 (longest request)
そして今回バージョンアップ後の数値は、50%で6.3秒、100%で9.4秒となっており43%の性能アップとなりました。
 そのときのサーバの状況が同じではないため一概には言えませんがここまで数値がよくなっているならばバージョンアップは成功といえるでしょう。
 またApachebenchの指標のひとつである 
 Requests per second (1秒間の何個のリクエストを処理できるか?)
  数値が高ければ高いほど性能が良いというもの
  バージョンアップ前 Requests per second: 1.51 [#/sec]
  バージョンアップ後 Requests per second: 2.26 [#/sec]
  
 こちらについても微々たるものですがアップしています。
 ApacheBenchなのでphpなどをバージョンアップした結果だと考えてます。
  こちらにも書いてあるとおり ——–> 「PHP 7」登場。10年ぶりのメジャーバージョンアップで実行速度はPHP 5の2倍以上に、PHPの生みの親が語る。PHPカンファレンス2015(前編)
 wordpressの実行速度もこれで速くなるそうです。
 PHPで動いているので当然といえば当然ですが・・・・。
  実際に体感ですがwordpressの表示速度も幾分速くなった気がします。
バージョンアップって結構な恩恵がありますね。 バージョンアップしてよかったです。
みなさんもワードプレスでブログ書いている人は、是非PHP7以上にあげることをお勧めします。
*****************************************************************************








