Simple Machines Community Forum

SMF Support => Server Performance and Configuration => Topic started by: ziycon on February 18, 2017, 09:09:49 PM

Title: Nginx/PHP-FPM Performance Issues
Post by: ziycon on February 18, 2017, 09:09:49 PM
I have setup a VM with Nginx and PHP-FPM running PHP 7.1.1 and all is setup and running ok. PHP is set to allow 256mb max. per script at a time, I've also set the PHP-FPM server configs quite low.

The issue I'm seeing is the below error, it takes a page about 4 minutes to load.

Quote2017/02/19 02:01:58 [error] 10999#0: *9 upstream timed out (110: Connection timed out) while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: www.example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.example.com"

Any help greatly appreciated.
Title: Re: Nginx/PHP-FPM Performance Issues
Post by: Jailer on February 18, 2017, 09:39:39 PM
Are you behind a proxy? That error looks like the proxy is closing the connection and not responding to the backend server. I would start by checking the keep-alive timeout on the proxy.

http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive (http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive)
Title: Re: Nginx/PHP-FPM Performance Issues
Post by: ziycon on February 19, 2017, 05:43:55 AM
Hi Jailer,

No, not behind a proxy, straight up standard configuration, all requests passed through to PHP-FPM by Nginx.

That link didn't seem to help, thanks though.
Title: Re: Nginx/PHP-FPM Performance Issues
Post by: 青山 素子 on February 21, 2017, 01:10:28 AM
Looks like a timeout on the PHP-FPM side. Have you confirmed that it's running and listening on the port you specified? If so, double-check the logs for the php-fpm process.