internetarchive / internetarchive/openlibrary
Have OL requests return before nginx returns a 504 to the client
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 2k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 138
Description
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](https://webpy.org/docs/0.3/api#web.utils) 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](https://github.com/infogami/infogami/blob/master/sample_infobase.yml#L13) 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
Contributor guide
Assessment
This issue has not been assessed yet.