パッケージをインストールして。
$sudo aptitude install php5-xcache
管理サイト用パスワードを作っておく。
$echo -n パスワード | md5sum
そしてINIファイルの編集
$sudo vi /etc/php5/conf.d/xcache.ini
[xcache.admin] xcache.admin.user = "xcache" xcache.admin.pass = (先ほど作ったパスワード) [xcache] xcache.size = 32M xcache.var_size = 1M xcache.mmap_path = "/tmp/xcache" xcache.optimizer = On [xcache.coverager] xcache.coverager = On xcache.coveragedump_directory = "/tmp/pcov/"
管理サイトをApacheに組み込み
$sudo vi /etc/apache2/conf.d/xcache.conf
Alias /xcache/admin /usr/share/xcache/admin Alias /xcache/coverager /usr/share/xcache/coverager
$sudo /etc/init.d/apache2 restart
phpinfoとかで見てみれば、問題無く組み込まれているかどうか分かる。
上で設定した管理サイトにアクセスすればキャッシュの状況が一目瞭然。
時々確認しながらキャッシュサイズを調節するのがよさげ。
恒例のベンチ結果。
Server Software: Apache/2.2.9
Server Hostname: gwazine
Server Port: 80
Document Path: /~lalah/wp/
Document Length: 5669 bytes
Concurrency Level: 1
Time taken for tests: 6.851 seconds
Complete requests: 1
Failed requests: 0
Write errors: 0
Total transferred: 6038 bytes
HTML transferred: 5669 bytes
Requests per second: 0.15 [#/sec] (mean)
Time per request: 6851.421 [ms] (mean)
Time per request: 6851.421 [ms] (mean, across all concurrent requests)
Transfer rate: 0.86 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 1 1 0.0 1 1
Processing: 6850 6850 0.0 6850 6850
Waiting: 6811 6811 0.0 6811 6811
Total: 6851 6851 0.0 6851 6851
2秒ぐらい効果あり。
実は、xcache.coverager = Off で、もう2秒ぐらい早くなるようなので、折りを見てOFFにすることにする。
これで使用に耐えうるレベルになったが、
今一番問題なのは、ヨメがめんどくさがってWordPressを使いたがらないことだ!
お後がよろしいようで・・・

コメントする