Timeout when taking more than 30 seconds during archiving

Archiving of certain websites fails sometimes with “504 Gateway Time-out” and I noticed this happens every time when the elapsed time takes more than 30 seconds.

Is there a way to alter this setting so that it waits a bit more before it throws an error? This happens during the reprocess of quite a big database.

That is a setting of your webserver or php-fpm, so you can change that.

At first, I thought the reverse proxy was at fault because the reverse proxy times out every 30 seconds. We changed this setting to 10 minutes just to be sure that the proxy is not at fault.

Still, whenever the timeout happens, it happens no matter what the reverse proxy setting is. The response as just hanging 10 minutes to give me the exact error that the server didn’t respond in time (10 minutes).

I had even changed all the settings in php.ini file about timeouts etc.

I left the archiving of the logs to continue during the weekend and I got this final message:

done: 1316/2062 64%, 0 vtoday, 1316 wtoday, 1316 wperiods, 4510 req, 116724362 ms, 1123 errors.
INFO [2019-05-05 01:08:43] 5802 Time elapsed: 116724.362s

So the thing is, sometimes the archiving works, and sometimes it fails, but how big the timeout is doesn’t make any difference.

So, I got some news.

Archiving keeps giving me the same error, but I have noticed that queries continue being executed in the database. While the server timeout is specific (I have tried different values), the db activity takes a lot longer, more than 1 hour for just 1 siteId. I noticed this in application logs with log_level DEBUG.

Is this a normal behavior?