sd_notify() support in nghttp2

nghttp2 is an implementation of HTTP/2. It comes as a set of libraries and tiny programs using them – a client, WWW server and a proxy. I've started using the last one, nghttpx, as a reverse proxy in few project and I'm quite content with.

Recently I implemented sd_notify() support in it. Explicit main PID tracking and readiness signaling works like a charm with systemd. sd_notify() protocol let us reliably supervise service even during hot-swap. That is, after receiving SIGUSR2, nghttpx executes new binary and tells systemd “this is main process now”. Old binaries can finish serving current requests and exit.

The pull request, after a round of comments and fixes, was merged into trunk after v1.19.0, so it will be in the next release. If you're willing to test, I'd ask you to check USR2 graceful shutdown branch, also. At the moment you need to manually SIGQUIT old processes after hot-swap. This branch is supposed to automate it.

And if you're maintain nghttp2 package in a distribution, please be sure to check changes in the service unit file.


Comments powered by Disqus