vps优化log1-xcache
vps上面装了xcache,速度明显快了很多。
安装方法
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
directAdmin中的php.ini是/usr/local/php.ini
编辑php.ini文件
php.ini 将 xcache.so的路径改为 /usr/lib/php/modules/xcache.so
修改php.ini xcache.admin.pass=”” 为md5(”密码”)的值
extension = ../xcache.so
;../为installing shared extensions
; xcache
xcache.admin.user = “admin”
xcache.admin.pass = “md5("password")”
复制xcache下面admin文件夹到网站目录。
如:$ cp -a ~/src/xcache/admin /var/www/example.com/htdocs/xcache-admin
config.php.example改为config.php,同样填入用户名和密码
$_SERVER["PHP_AUTH_USER"] = “admin”;
$_SERVER["PHP_AUTH_PW"] = “md5(“password”)”;
性能测试
测试语句
ab -n 100000 http://localhost/phpmyadmin
未安装xcache:
Requests per second: 5910.08 [#/sec] (mean)
安装xcache后
Requests per second: 6267.32 [#/sec] (mean)
相关日志
| 打印文章 | 这篇文章由止戈于2009年10月14日 9:58 下午发表在seo&sem, 代码如诗。你可以订阅RSS 2.0 也可以发表评论或引用到你的网站。 |
大约9月前
xCache这个还不是我教你的。。你的tmp文件调了多大?你设好了临时文件了吗?
大约9月前
老子自己网上找资料的好不?这些还没弄,不急的,反正现在站点少……
大约9月前
站点还少?现在我都放了4个人上去了,还少。。xcache的临时文件起码要128M,并且那个文件你还要手动建立,并且设置777权限啊。。还有,不要装zend optimizer和memcached,不然死机了不要骂我
大约9月前
你把网站备份下,现在目录里面只要有/config/的就指向了directadmin了,估计弄不好我就得还原了。
大约9月前
翻看一下da官方论坛,这个好像是 da自身的问题,装mediawiki这个冲突是免不了的了。
http://www.directadmin.com/forum/archive/index.php/t-15031.html
大约9月前
如果可以的话,能否测试下apc的情况和xcache的比下,在php5的代码下哪个好一些呢?
我xcache没用过…
大约9月前
你可以叫前面回复的jerry chen来弄下,他是超级小白鼠
大约9月前
She reports that she couldn’t focus on the coursework until she got out of the classroom. ,
大约9月前
xcache的好处就是减少了频繁编译php的过程,降低资源占用,对个人站来说xcache让php接近或等同html的运行效率,还是不错的。不知道博主用的什么webserver,xcache是基于lighttpd的mod形式开发的,应该和lighttpd结合的效率最高。另:其实可以用xcache administrator去查看缓存的命中率和缓存内容,发行包自带web管理组件的。
大约9月前
Originally branded under the main family name, it was changed to Now Hity later in the run. ,