openlibrary icon indicating copy to clipboard operation
openlibrary copied to clipboard

Have OL requests return before nginx returns a 504 to the client

Open SouthGoingZax opened this issue 6 years ago • 0 comments

Occasionally there are requests that consistently take a long time to return (e.g., #3896, #4136). nginx has a 60 second timeout, at which point an HTTP 504 is returned to the user by nginx. This prevents the use of standard OL troubleshooting URL parameters like debug=true and _profile=true.

Describe the problem that you'd like solved

It would be nice if OL returned a response before nginx so we could see _profile and/or debug statements.

Proposal & Constraints

I'm not sure what the best way to do this is. web.py has a timelimit decorator that could be interesting, but my experimenting so far has resulted in various errors I still need to look into more. Infogami also has a query_timeout configuration variable that looks interesting, but when I set it locally, the codepath that enables throws an error (that I haven't looked into yet).

Additional context

Stakeholders

@mekarpeles @cdrini

SouthGoingZax avatar Nov 24 '20 22:11 SouthGoingZax