-
Notifications
You must be signed in to change notification settings - Fork 846
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 basic connection management and keep alive parameters #1334
Conversation
My proposal for default values:
|
service/frontend/service.go
Outdated
KeepAlivePermitWithoutStream: dc.GetBoolProperty(dynamicconfig.KeepAlivePermitWithoutStream, true), | ||
KeepAliveMaxConnectionIdle: dc.GetDurationProperty(dynamicconfig.KeepAliveMaxConnectionIdle, 10*time.Minute), | ||
KeepAliveMaxConnectionAge: dc.GetDurationProperty(dynamicconfig.KeepAliveMaxConnectionAge, 20*time.Minute), | ||
KeepAliveMaxConnectionAgeGrace: dc.GetDurationProperty(dynamicconfig.KeepAliveMaxConnectionAgeGrace, 2*time.Minute), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add comment here saying that this needs to be slightly bigger than long poll interval. And there is another parameter which also correlates with long poll interval.
Discussed with Alex/Wenquan, and adjusted numbers accordingly. |
Discussed with @mfateev and agreed on a set of parameters that are slightly different from what we've discussed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MinTime: minimum amount of time a client should wait before sending a keepalive ping. Default 10 sec Rationale - make sure that clients can set minimal value of 10 sec without breaking connections.
at least this number is too small, let us sync
changing from every 60s to every 10s is 6x increase in amount of load in terms of pinging.
although ping itself is lightweight, it still consume network traffic and requires frontend to respond, meaning health check is not free
Note that this property defines low end of the range, it doesn't mean we would go as low. In fact I anticipate default on the client side should be 30 sec or 1 min, with a possibility of an override to a lower value, which some OSS clients may want if they would like to detect failures faster and don't have too many workers. |
@@ -268,11 +292,25 @@ func (s *Service) Start() { | |||
) | |||
|
|||
opts, err := s.params.RPCFactory.GetFrontendGRPCServerOptions() | |||
kep := keepalive.EnforcementPolicy{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment here specifying that the configs below are intended for small scale use case
Summary:
Added default keep-alive server parameters and enforcement policy for gRPC connection management.
This compliments client-side changes that we recently made in Go and java SDKs.
List of added properties (with frontend.keepAlive prefix) and their default values: