How to fix "upstream timed out (110: Connection timed out) while reading" error in Nginx and PHP-FPM

"Upstream timed out (110: Connection timed out) while reading upstream" error may occur when it takes more than 60 seconds for PHP-FPM backend to respond.

[error] upstream timed out (110: Connection timed out) while reading upstream, client: x.x.x.x, server:, request: "GET /script.php HTTP/1.1", upstream: "fastcgi://"

Upstream timed out error happens if you have long running fastcgi processes, for example parsing large XML or CVS files, that do not produce output until they have finished processing. Nginx waits for fastcgi backend to respond for 60 seconds by default. If it takes more than that, the request is stopped.

You can fix this problem by changing the value of fastcgi_read_timeout parameter in nginx.conf. fastcgi_read_timeout directive sets the amount of time for upstream to wait for a fastcgi process to send data. To handle long running fastcgi processes increase this parameter to 600 seconds:

http {
    fastcgi_read_timeout 600s;

This should help to fix the problem.

  1. Solo_Kamen
    2016-01-09 10:18:13
    It didn´t

Got a comment?

captcha =


  1. System (20)
    1. FreeBSD (5)
    2. Linux (9)
  2. Email (2)
  3. DNS (2)
  4. Databases (1)
  5. WebServer (27)
Copyright © 2024 HowToUnix - *nix Howtos and Tutorials
All Rights Reserved.