rajankaneria
rajankaneria

Reputation: 193

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.

Upvotes: 16

Views: 16105

Answers (2)

anoraq
anoraq

Reputation: 17

One alternative is also to load parts of the page, for instance the list (or whatever) with only the names, and basic info. And after load do the rest with jquery and ajax.

Upvotes: 0

Sergei Lomakov
Sergei Lomakov

Reputation: 2061

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

Upvotes: 14

Related Questions