現在入ってるのは、PHP5.1.6。
5.2系へのUpdateは、適当なSRPMを探すのが面倒なので、とりあえず見送り。
結論から言うと、eAcceleratorの導入で、応答速度は1/3近くまで短縮される模様。
本当は、Apacheも2.0から2,2にしようと思いましたが、SRPMからのrebuildだとApache Portable Runtimeのインストール時に、稼動中ソフト/ライブラリとの兼ね合いで弄りが必要となり、心が折れました。
ソースからmakeすればいいじゃん。という説もありますが、一介の金融系サラリーマンでnerdでもgeekでも無いワタクシは、PKG管理派に宗旨替えをしていますので。
前回のeAcceleratorインストール時は、未だPHP4.4.4でした。その時の手順を思い出しながら、こちらはソースからbuild。
[eAcceleratorのインストール]
$ wget http://jaist.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.5.2.tar.bz2
$ bunzip2 -dc eaccelerator-0.9.5.2.tar.bz2 | tar xvf -
$ cd eaccelerator-0.9.5.2
$ /usr/bin/phpize
$ ./configure --enable-eaccelerator=shared --with-php-config=/usr/bin/php-config --with-eaccelerator-info
$ make
$ su
# make install
Installing shared extensions: /usr/lib/php/modules/
[設定]
$ cp control.php /var/www/VirtualHosts/kenji00/***.kenji00.com/htdocs/
$ vi /var/www/VirtualHosts/kenji00/***.kenji00.com/htdocs/control.php
$user = "*******";
$pw = "********";
$ mkdir /tmp/eaccelerator
# chown apache:apache /tmp/eaccelerator/
# cp eaccelerator.ini /etc/php.d/eaccelerator.ini
# vi /etc/php.d/eaccelerator.ini
zend_extension = "/usr/lib/php/modules/eaccelerator.so"
eaccelerator.allowed_admin_path = "/var/www/VirtualHosts/kenji00/***.kenji00.com/htdocs/control.php"
[TEST]
# /etc/init.d/httpd restart
では、テストしてみましょう。
先ずは1回目。インストール済みのcontrol.phpで、Cachingを無効にしています。
$ ab -n 100 -c 10 http://***.kenji00.com/index.php
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.121.2.1 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
Benchmarking cat.kenji00.com (be patient).....done
Server Software: Apache
Server Hostname: ***.kenji00.com
Server Port: 80
Document Path: /index.php
Document Length: 14311 bytes
Concurrency Level: 10
Time taken for tests: 87.545530 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 1472400 bytes
HTML transferred: 1431100 bytes
Requests per second: 1.14 [#/sec] (mean)
Time per request: 8754.553 [ms] (mean)
Time per request: 875.455 [ms] (mean, across all concurrent requests)
Transfer rate: 16.41 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.7 0 7
Processing: 3032 8546 7254.4 6660 43925
Waiting: 2864 7979 6574.6 6347 43761
Total: 3032 8546 7254.3 6660 43925
Percentage of the requests served within a certain time (ms)
50% 6660
66% 8256
75% 9568
80% 10456
90% 15477
95% 19389
98% 43640
99% 43925
100% 43925 (longest request)
次は、Caching有効時。テストしているURLのcacheがあることをcontrol.phpで確認して.....
$ ab -n 100 -c 10 http://***.kenji00.com/index.php
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.121.2.1 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
Benchmarking cat.kenji00.com (be patient).....done
Server Software: Apache
Server Hostname: ***.kenji00.com
Server Port: 80
Document Path: /index.php
Document Length: 14311 bytes
Concurrency Level: 10
Time taken for tests: 38.965838 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 1472400 bytes
HTML transferred: 1431100 bytes
Requests per second: 2.57 [#/sec] (mean)
Time per request: 3896.584 [ms] (mean)
Time per request: 389.658 [ms] (mean, across all concurrent requests)
Transfer rate: 36.88 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.7 0 5
Processing: 1436 3836 2701.9 3168 15025
Waiting: 1369 3589 2436.0 3039 14516
Total: 1441 3836 2701.9 3168 15025
Percentage of the requests served within a certain time (ms)
50% 3168
66% 4204
75% 5329
80% 5745
90% 7480
95% 9817
98% 13015
99% 15025
100% 15025 (longest request)
最近のコメント