Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions go/vt/servenv/grpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ var (
// The lower bound for window size is 64K and any value smaller than that will be ignored.
GRPCInitialWindowSize = flag.Int("grpc_server_initial_window_size", 0, "grpc server initial window size")

// EnforcementPolicy MinTime that sets the keepalive enforcement policy on the server.
// This is the minimum amount of time a client should wait before sending a keepalive ping.
GRPCKeepAliveEnforcementPolicyMinTime = flag.Duration("grpc_server_keepalive_enforcement_policy_min_time", 5*time.Minute, "grpc server minimum keepalive time")

authPlugin Authenticator
)

Expand Down Expand Up @@ -143,6 +147,11 @@ func createGRPCServer() {
opts = append(opts, grpc.InitialWindowSize(int32(*GRPCInitialWindowSize)))
}

ep := keepalive.EnforcementPolicy{
MinTime: *GRPCKeepAliveEnforcementPolicyMinTime,
}
opts = append(opts, grpc.KeepaliveEnforcementPolicy(ep))

if GRPCMaxConnectionAge != nil {
ka := keepalive.ServerParameters{
MaxConnectionAge: *GRPCMaxConnectionAge,
Expand Down