ab命令是apache自带的用于web服务器压力测试用的
ab命令使用:
/usr/local/apache/bin/ab -c 2000 -n 80000 http://192.168.61.161/index.html
注意:当并发量太大时,会报错(too many open files)
原因 : ab在压力测试时,打开的socket过多
解决: ulimit -n 30000 (重启失效)
nginx性能统计模块安装:
./configure --prefix=/usr/local/nginx/ --add-module=/usr/local/src/ngx_http_consistent_hash-master/ --with-http_stub_status_module
make && make install
修改nginx配置文件信息:
location /status {
stub_status on;
access_log off;
}
在浏览器上访问:http://192.168.61.161/status
就会看到nginx被访问的统计数据信息