Skip to content
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

Add support for server side connection management:MAX_CONNECTION_AGE #752

Open
alexframe opened this issue Aug 11, 2023 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@alexframe
Copy link

Is your feature request related to a problem? Please describe.

gRPC has an implemented proposal for server side connection management.

It providers options to configure a gRPC server to manage connections. One very useful option is the MAX_CONNECTION_AGE.

MAX_CONNECTION_AGE is a duration for the maximum amount of time a connection may exist before it will be shut down. When a connection exceeds the configured age the server should send GOAWAY with status code NO_ERROR and ASCII debug data max_age and then continue the graceful connection termination. Specifically, outstanding RPCs should be permitted to complete, and implementations are encouraged to initially set the last stream identifier to 231-1. This option can force the client to periodically reconnect to a L4 LB which allows spreading load more quickly. A per-connection random jitter of +/-10% will be added to MAX_CONNECTION_AGE to spread out connection storms. Note that this option without jitter would not create connection storms by itself, but if there happened to be a connection storm it could cause it to repeat at a fixed period.

This is a rather specific implementation so maybe this would make sense to be an option in connect, instead of having to have users implement it in each server.

As an example implementation, this is in grpc-js as grpc. max_connection_age_ms, with the following documentation.

Having this setting available is great as by setting it, it can allow us to force connections to be cleaned up, this also helps tremendously with load balancing.


Describe the solution you'd like
I would like the max connection age to be a configurable option when creating a connect adapter for Node, as this is a server setting.

In an ideal world, all of sensible connection management options in the above linked proposal would be implemented, however the MAX_CONNECTION_AGE would be a fantastic start.

Describe alternatives you've considered
An alternative is to let the users of connect implement their own http2 session tracking and management.

This is definitely doable, but given the specific implementation details, with jitter etc, it would be great to centralise this in the connect package.

Additional context
A brief thread about this on your public slack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant