I use Nginx Django FastCGI to run a service to process a huge XML. The file is too large and the processing is slow. It times out halfway through the process.
I changed the Nginx configuration. It was originally 60 and changed to 120, but it seems to have no effect. It still times out in 60 seconds.
location ^~ /api/ { proxy_read_timeout 120; proxy_connect_timeout 120; fastcgi_pass 127.0.0.1:8080; }
Is there anything else that needs to be changed?
黄舟2017-05-16 17:31:42
should use:
fastcgi_read_timeout 600; fastcgi_send_timeout 600;
These two options.
fastcgi_read_timeout refers to the timeout of the entire process of sending a response from the fastcgi process to the nginx process
fastcgi_send_timeout refers to the timeout of the entire process of the nginx process sending a request to the fastcgi process
Both options default to seconds (s) and can be manually specified as minutes (m), hours (h), etc.
PHPz2017-05-16 17:31:42
For pages that take a long time to process events, it is best to change to asynchronous processing. The connection time of Nginx does not seem to exceed 75 seconds.
fastcgi_connect_timeout 75; fastcgi_read_timeout 120; fastcgi_send_timeout 120;
http://wiki.nginx.org/HttpFastcgiModu...
漂亮男人2017-05-16 17:31:42
proxy is the time for the proxy to communicate with the backend, and the fastcgi timeout needs to be modified