PHP接口并发测试的时候显示大量的502,但是CPU和内存都是正常的状态;
错误日志如下
connect() to unix:/data/php-fpm.sock failed Resource temporarily unavailable) while connecting to upstream
connect() to unix:/data/mystack/sites/app.pulanxian.com/php-pool/php-fpm.sock failed
connect() to unix:/data/mystack/sites/app.pulanxian.com/php-pool/php-fpm.sock failed (11: Resource temporarily unava 58483 ilable) while connecting to upstream
connect() to unix:/data/mystack/sites/app.pulanxian.com/php-pool/php-fpm.sock failed (11: Resource temporarily unava 29585 ilable) while connecting to upstream
connect() to unix:/data/mystack/sites/app.pulanxian.com/php-pool/php-fpm.sock failed (11: Resource temporarily unava 29585 ilable) while connecting to upstream,
下面是解决的办法;
并发情况下发现接口请求耗时比较长;
修改php.ini
nginx 使用的是 unix:php-fpm.sock
max_execution_time = 60
memory_limit = 256M /默认128
default_socket_timeout = 180 //最最重要的参数