503 timeout for long requests



We have a long running process in our backend that is causing a 503 timeout issue for a few POST requests. In our vcl_recv, we have the following condition:

if (req.request != "HEAD" && req.request != "GET" && req.request != "FASTLYPURGE") {

Therefore, all POST requests are passed. The connect_timeout, first_byte_timeout properties are set to 2 minutes, which should be plenty of time for these requests to finish. However, we are still seeing a significant amount of 503 responses.

I’ve reached out to Fastly support, which suggested that the timeout may be occurring between our shielding POPs (there’s a hard 60s timeout enforced by Fastly). However, we need the shielding in order to use the image optimizer…

Has anyone else encountered a similar issue?