实时检测HTTPD连接数:
watch -n 1 -d "pgrep httpd|wc -l"
ps -ef | grep httpd | wc -l
返回结果示例:
1388
表示Apache能够处理1388个并发请求,这个值Apache可根据负载情况自动调整,我这组服务器中每台的峰值曾达到过2002。
安装memcached @ CentOS
* memcached homepage:
http://www.danga.com/memcached/
yum install memcached
chkconfig memcached on
service memcached start
vi /etc/sysconfig/memcached
# set listening host to localhost
OPTIONS="-l 127.0.0.1"
If you use a different version of php from the one in official CentOS repo, you need to compile the php memcache extension (php-pecl-memcache) by yourself. Just download the source rpm from the CentOS Extras repository and build it.