WordPressの高速化・PHPアクセラレータ「APC」

WordPressを2.5倍速くするPHPアクセラレータ「APC」

興味深い記事がありましたので、今回はこの「APC」というものを試してみます。

しかし現在使用しているマザーボードのCPUはC60なので、あまり期待はできそうにないかもしれません。

[root@pc-centos ~]# ab -n 100 -c 10 https://dukehide.com/wordpress/com/
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking dukehide.dip.jp (be patient).....done

Server Software: Apache/2.4.6
Server Hostname: dukehide.dip.jp
Server Port: 80

Document Path: /wordpress/com/
Document Length: 74059 bytes

Concurrency Level: 10
Time taken for tests: 151.048 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 7450200 bytes
HTML transferred: 7405900 bytes
Requests per second: 0.66 [#/sec] (mean)
Time per request: 15104.818 [ms] (mean)
Time per request: 1510.482 [ms] (mean, across all concurrent requests)
Transfer rate: 48.17 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.3 0 1
Processing: 10417 14256 1308.0 14229 17078
Waiting: 6643 10533 1011.1 10461 13001
Total: 10418 14256 1308.0 14229 17078

Percentage of the requests served within a certain time (ms)
50% 14229
66% 14775
75% 15142
80% 15317
90% 15679
95% 16677
98% 16982
99% 17078
100% 17078 (longest request)

なるほど…現状はこれくらいだったんですね。ではAPCをインストール。

# yum -y install php-devel php-pear gcc

# pecl install apc

# vi /etc/php.d/apc.ini
extension = apc.so
apc.shm_size = 128M
apc.enable_cli = 1
;apc.filters = filename

インストールや設定等はサイトの手順通りに行えば問題なく進みます。

[root@pc-centos ~]# systemctl restart httpd
[root@pc-centos ~]# ab -n 100 -c 10 https://dukehide.com/wordpress/com/
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking dukehide.dip.jp (be patient).....done

Server Software: Apache/2.4.6
Server Hostname: dukehide.dip.jp
Server Port: 80

Document Path: /wordpress/com/
Document Length: 74059 bytes

Concurrency Level: 10
Time taken for tests: 87.648 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 7450200 bytes
HTML transferred: 7405900 bytes
Requests per second: 1.14 [#/sec] (mean)
Time per request: 8764.769 [ms] (mean)
Time per request: 876.477 [ms] (mean, across all concurrent requests)
Transfer rate: 83.01 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.3 0 1
Processing: 4297 7951 1392.8 7820 11055
Waiting: 1995 4685 1078.2 4498 7845
Total: 4297 7952 1392.9 7820 11055

Percentage of the requests served within a certain time (ms)
50% 7820
66% 8437
75% 8978
80% 9138
90% 9793
95% 10572
98% 10897
99% 11055
100% 11055 (longest request)

若干速くはなりましたが、やっぱりC60ではこんなものですね。処理速度より低消費電力重視で選びましたから… (^^;)

Follow me!

コメントを残す

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください