-
Notifications
You must be signed in to change notification settings - Fork 434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Graceful restart with tableflip #787
Labels
Comments
This issue is marked as stale because it has been open over 90 days with no activity. Remove the stale label or comment or this will be closed in 15 days. |
This issue is marked as stale because it has been open over 90 days with no activity. Remove the stale label or comment or this will be closed in 15 days. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version of KrakenD you are using
Is your feature request related to a problem? Please describe.
Restarting krakend always comes with a short downtime on that machine, as the old process is shutting down, thus closing the HTTP listen socket, and then a new process is starting up, doing some initializing and only then starts listening. Usually, high availability for an API gateway is desired.
Describe the solution you'd like
Implement graceful restart via cloudflare/tableflip. The restart works like so:
If the new process fails during initialization, such as panicking due to an invalid config file, or exceeding a configurable startup timeout, the old process won't shut down and still serves requests. Therefore, it's ensured that at any time, there is a usable krakend process running.
This graceful restart strategy is in fact inspired by nginx reloads, see Cloudflare's blogpost.
Describe alternatives you've considered
The documentation recommends using blue/green deployments. While this can be straightforward in a Kubernetes or Cloud setup, it might not be usable in all situations. Having a simple builtin graceful restart functionality, just like nginx, makes it possible to update the configuration with zero downtime and without changing anything in the server infrastructure. I would consider this as an alternative restart option, so we have different options that are more or less suited for different setups.
The text was updated successfully, but these errors were encountered: