You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #1672 - jtgeibel:hyper-graceful-shutdown, r=jtgeibel
Add support for graceful shutdown of the server
The server process now intercepts SIGINT and SIGTERM to initiate a
graceful shutdown of the server.
This is useful when tracking memory leaks locally, as both `hyper` and
`civet` are given a chance to return memory and shutdown cleanly.
However, this will not improve things in production as we also run an
instance of `nginx`, which will close all connections after receiving a
SIGTERM from Heroku. From my preliminary investigation, it appears we
may need to customize the buildpack to change this behavior.
Additionally, the server will now briefly sleep before notifying Heroku
that it is ready to receive connections. Also, when using `hyper` the
`Runtime` is configured to use 4 background threads. This overrides
the default, which is one thread per CPU and provides consistency
between differently sized dynos. The number of `conduit` background
threads are still configured via `SERVER_THREADS` and defaults to 50
in production.
0 commit comments