php-fpm常见错误
原创
©著作权归作者所有:来自51CTO博客作者zlixing的原创作品,请联系作者获取转载授权,否则将追究法律责任
1. WARNING: Nothing matches the include pattern '/usr/local/php7/etc/php-fpm.d/*.conf'
# cd /usr/local/php/etc/php-fpm.d/
# cp www.conf.default www.conf
# /usr/local/php/sbin/php-fpm -t
[12-Oct-2017 08:33:29] NOTICE: configuration file /usr/local/php/etc/php-fpm.conf test is successful
[root@localhost php-fpm.d]# service php-fpm start
Starting php-fpm done
2. Starting php-fpm [16-Jan-2020 13:06:36] ERROR: [pool www] cannot get uid for user 'nginx'
3. 错误日志出现
[17-Jan-2017 14:38:06] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 170 idle, and 237 total children
解决:看一下net.core.somaxconn这个值,它定义了系统中每一个端口最大的监听队列的长度,这是个全局的参数,默认值为128;如果这个值过小,是会造成这种情况的
cat /proc/sys/net/core/somaxconn
128
修改
echo 1000 >/proc/sys/net/core/somaxconn