存档

文章标签 ‘xcache’

nginx apache xcache 效果对比测试

2008年11月23日

安装后我进行了测试以下为测试结果
分别开启关闭xcache 运行两次ab -n 1000 http://bbs.k12zy.com/forum-19-1.html

Server Software: nginx/0.6.33
Server Hostname: bbs.k12zy.com
Server Port: 80
Document Path: /forum-19-1.html
Document Length: 32118 bytes

Time taken for tests: 38.976547 seconds
Requests per second: 25.66 [#/sec] (mean)
Time per request: 38.977 [ms] (mean)
Time per request: 38.977 [ms] (mean, across all concurrent requests)
Transfer rate: 814.16 [Kbytes/sec] received

Time taken for tests: 17.326479 seconds
Requests per second: 57.72 [#/sec] (mean)
Time per request: 17.326 [ms] (mean)
Time per request: 17.326 [ms] (mean, across all concurrent requests)
Transfer rate: 1831.47 [Kbytes/sec] received

那么apache服务器的效果如何呢,又做了测试

Server Software: Apache/2.2.3
Server Hostname: 121.250.15.4
Server Port: 80
Document Path: /forum-19-1.html
Document Length: 32116 bytes

Time taken for tests: 32.138246 seconds
Requests per second: 31.12 [#/sec] (mean)
Time per request: 32.138 [ms] (mean)
Time per request: 32.138 [ms] (mean, across all concurrent requests)
Transfer rate: 988.04 [Kbytes/sec] received

Time taken for tests: 20.6633 seconds
Requests per second: 49.98 [#/sec] (mean)
Time per request: 20.007 [ms] (mean)
Time per request: 20.007 [ms] (mean, across all concurrent requests)
Transfer rate: 1587.17 [Kbytes/sec] received

 其中红色为开启xcache的值

结果来看开启xcache肯定要快,至于apache和nginx的fastcgi来比较缺让人看的不清楚, 只能解释由于第一次测试的是nginx不开xcache可能在数据库端使其变慢,都以一次测试的值也不能算作科学统计,仅做为自己的测试吧。

linux, 我的网站 , , , ,

安装 xcache 加速php

2008年11月22日

在服务器中安装了xcache,来加速php的运行。

关于xcache 可以查看 http://www.ibm.com/developerworks/cn/opensource/os-php-fastapps1/

yum install php-devel

wget http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz
tar -xvf xcache-1.2.2.tar.gz
cd xcache-1.2.2
phpize

./configure –enable-xcache –enable-xcache-coverager
make
make install

得到结果:
Installing shared extensions:     /usr/lib/php/modules/
将配置加入php.ini
cat xcache.ini >> /etc/php.ini

编辑php.ini 将 xcache.so的路径改为  /usr/lib/php/modules/xcache.so
重启fastcgi spawn-fcgi -a 127.0.0.1 -p 9000 -C 5 -u nobody -g nobody -f /usr/bin/php-cgi
安装 XCache Administration
修改php.ini xcache.admin.pass=”” 为md5(“密码”)的值

复制 admin 文件夹到web目录

浏览器中浏览

启用后居然不管用原来默认配置中xcache.size和xcache.var_size都是0M  改成合适的数值就好

参考:http://www.ibm.com/developerworks/cn/opensource/os-php-fastapps1/

linux, 我的网站 , , ,