服务器是4核8G的,带宽10M
系统使用的是lnmp环境,其中mysql是用另一台服务器搭建
我编辑php-fpm的配置文件:vi /etc/php-fpm.d/www.conf
将pm.max_children设为600,但是实用压测工具,实际并发只支持100,内存也没跑满,峰值大概用了60%
压测情况:
使用jmeter进行压测,线程数300,循环10次
压测结果:
运行时间为30秒左右,并出现10几个超时请求
php-fpm配置:
pm = static
pm.max_children = 600
nginx配置:
user nginx;
worker_processes auto;
worker_rlimit_nofile 20480;
error_log /www/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
use epoll;
worker_connections 20480;
multi_accept on;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /www/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 200;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
其中有将pm.max_children加大到800和1000,但是压测结果基本一样
为什么并发没有达到设置的pm.max_children值,想实现500的并发要怎么做?