I have a PHP script that is running on Google Cloud Engine which fires an SQL query and the query sometimes takes more than 60 second to execute.
If the request fails to return within 60 seconds and a DeadlineExceededError
is thrown and not caught, the request is aborted and a 500 internal server error is returned. Following is mentioned in the documentation.
The Google App Engine request timer (Java/Python/Go) ensures that requests have a finite lifespan and do not get caught in an infinite loop. Currently, the deadline for requests to frontend instances is 60 seconds. (Backend instances have no corresponding limit.) Every request, including warmup (request to /_ah/warmup) and loading requests ("loading_request=1" log header), is subject to this restriction
I have gone through this link which explains how to avoid such error but my query is running on a heavy database, which takes a while to fetch all results.
My question is how can I increase the request timer to be able to run long running tasks. If not possible is there any alternatives to achieve such a thing.