vps优化log1-xcache

vps上面装了xcache,速度明显快了很多。

安装方法

wget http://.lighttpd.net/pub/Releases/1.2.2/-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)



  1. xCache这个还不是我教你的。。你的tmp文件调了多大?你设好了临时文件了吗?

    • 老子自己网上找资料的好不?这些还没弄,不急的,反正现在站点少……

      • 站点还少?现在我都放了4个人上去了,还少。。xcache的临时文件起码要128M,并且那个文件你还要手动建立,并且设置777权限啊。。还有,不要装zend optimizer和memcached,不然死机了不要骂我

    • af
    • 十月 22nd, 2009

    如果可以的话,能否测试下apc的情况和xcache的比下,在php5的代码下哪个好一些呢?

    我xcache没用过…

  2. She reports that she couldn’t focus on the coursework until she got out of the classroom. ,

  3. xcache的好处就是减少了频繁编译php的过程,降低资源占用,对个人站来说xcache让php接近或等同html的运行效率,还是不错的。不知道博主用的什么webserver,xcache是基于lighttpd的mod形式开发的,应该和lighttpd结合的效率最高。另:其实可以用xcache administrator去查看缓存的命中率和缓存内容,发行包自带web管理组件的。

  4. Originally branded under the main family name, it was changed to Now Hity later in the run. ,

    • kmlxk
    • 九月 17th, 2011

    我勒个去,怎么感觉我的VPS上xcache的变量缓存效率跟文件来做缓存差不多,甚至有时候更慢呢,纠结,是不是把apache换了会好点

  1. 还没有引用通告。