xcache加速php
1、下载http://xcache.lighttpd.net/wiki/Release-1.2.2
2.安装
tar zxvf xcache-1.2.2.tar.gz
cd xcache-1.2.2
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --enable-xcache --enable-xcache-optimizer
make
make install
3、配置文件(取得前面的;)
password 可以执行 echo -n '123456' | md5sum
在/usr/local/php/etc/php.ini添加入下内容
;
;zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/xcache.so
;;zend_extension = xcache.so
;
;; Change xcache.admin.user to your preferred login name
;xcache.admin.user = "xcache"
;; Change xcache.admin.pass to the MD5 fingerprint of your password
;; Use md5 -s "your_secret_password" to find the fingerprint
;xcache.admin.pass = "eb55c7896be0d6ceafc3fe83c62c2a48"
;
;; Change xcache.size to tune the size of the opcode cache
;xcache.size = 128M
;xcache.shm_scheme = "mmap"
;; cpu number (cat /proc/cpuinfo |grep -c processor)
;xcache.count = 4
;xcache.slots = 8K
;xcache.ttl = 0
;xcache.gc_interval = 0
; Change xcache.var_size to adjust the size of variable cache
;xcache.var_size = 8M
;; cpu number (cat /proc/cpuinfo |grep -c processor)
;xcache.var_count = 2
;xcache.var_slots = 8K
;xcache.var_ttl = 0
;xcache.var_maxttl = 0
;xcache.var_gc_interval = 300
;xcache.test = Off
;xcache.readonly_protection = On
;xcache.mmap_path = "/dev/zero"
;xcache.coredump_directory = ""
;xcache.cacher = On
;xcache.stat = On
;xcache.optimizer = Off
;;
;;;xcache.coverager = On
;;xcache.coveragedump_directory = ""
用ab -n10000o http://localhost/index.php
感觉和eaccelerator不相上下 版权声明:本文为博主原创文章,未经博主允许不得转载。
页:
[1]