Skip to content

Commit

Permalink
chore(gunicorn): reduce timeout from 90 seconds to 15 seconds (#11523)
Browse files Browse the repository at this point in the history
This is not the request timeout, but rather the time between the worker
notifying the arbiter that it is still alive. This is runs in the main
loop of the [gthread
worker](https://labs.openai.com/s/YaxC326oohNreRzdYEzkmQdd) which should
be pretty tight.

We might even consider reducing this further.

TODO: allow these vars to be set by whatever is running this. There are
dependencies between this value and e.g. the downstream proxy server
timeouts.
  • Loading branch information
Harry Waye authored Aug 26, 2022
1 parent d4a96f0 commit ad590ea
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gunicorn.config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@

loglevel = "error"
keepalive = 120
timeout = 90

# Set the timeout to something lower than any downstreams, such that if the
# timeout is hit, then the worker will be killed and respawned, which will then
# we able to pick up any connections that were previously pending on the socket
# and serve the requests before the downstream timeout.
timeout = 15

grateful_timeout = 120


Expand Down

0 comments on commit ad590ea

Please sign in to comment.