I have a compute engine VM instance with a docker image. It has a server that does expensive computations that take around 2 minutes for each request.
The server responds perfectly for small requests. For larger ones it responds with the following:
<HEAD><TITLE>Connection Timed Out</TITLE></HEAD> <BODY BGCOLOR="white" FGCOLOR="black"> <FONT FACE="Helvetica,Arial"><B> Connection Timed Out</B></FONT> <!-- default "Connection Timed Out" response (504) --> </BODY>
The server in my docker container does not return this.
Looking at what 504 errors mean:
The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI (e.g. HTTP, FTP, LDAP) or some other auxiliary server (e.g. DNS) it needed to access in attempting to complete the request. Note: Note to implementors: some deployed proxies are known to return 400 or 500 when DNS lookups time out.
That clearly shows that compute engine has a proxy that times out after 30 seconds and gives the above response.
Looking at the stackdriver logs I see that my server does receive the request and does process it, but before it's finished, I get the response above instead.
How do I stop compute engine from intervening with my server logic? Or at least how do I increase the timeout limit?