Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase page timeout to prevent 504 error?

I am running a file with considerable amount of code and have to process it for 1000 users. It takes approximately 55 seconds to process 500 users, so I have to increase the default gateway timeout time.

From this question, I found that I have to increase fastcgi_read_timeout, but I don't know where to put it in fastcgi.conf.

like image 834
rajankaneria Avatar asked Feb 03 '12 05:02

rajankaneria


1 Answers

fastcgi_read_timeout should be put into a location which you're using for processing requests to your file.

location {
     fastcgi_pass you.app:9000;
     ... 
     fastcgi_read_timeout 900s; # 15 minutes
}

Please, see more examples in documentation

like image 56
Sergei Lomakov Avatar answered Oct 02 '22 14:10

Sergei Lomakov