I'm stumped. Whatever fastcgi_read_timeout I set is barely not enough.

When I load a page for the first time, I get a fastcgi timeout:

upstream timed out (110: Connection timed out) while reading response header from upstream
upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock"

OK. I had a timeout of 30 seconds. It would timeout, and I'd refresh the page and it would render quickly. It must have needed 35, right?

So I set timeout to 300 seconds. Same behavior. It times out on the first load, but succeeds quickly on all subsequent loads.

I'm guessing this has to do with building the cache, but how do I get it to stop failing on the first hit?

Comments

kleinfelter’s picture

So now my timeout is 5 minutes. I go to load a page. I wait 15 seconds without a response. I reload the page and I get an immediate response with the complete page.

The first fetch of a page is failing and it fails because it is first and not because it takes too long to respond.