Skip to content

Commit

Permalink
refactor: Update MaxConnectionAge and MaxConnectionAgeGrace values
Browse files Browse the repository at this point in the history
  • Loading branch information
mattevans committed Dec 3, 2024
1 parent 12e9090 commit 72fd34a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,14 @@ func (x *Xatu) startGrpcServer(ctx context.Context) error {
),
)

// MaxConnectionAge/MaxConnectionAgeGrace should exceed NGINX's grpc_read_timeout and grpc_send_timeout to
// prevent NGINX from terminating connections before the server's age limit is reached.
opts := []grpc.ServerOption{
grpc.MaxRecvMsgSize(mb100),
grpc.KeepaliveParams(keepalive.ServerParameters{
MaxConnectionIdle: 5 * time.Minute,
MaxConnectionAge: 10 * time.Minute,
MaxConnectionAgeGrace: 2 * time.Minute,
MaxConnectionAge: 12 * time.Minute,
MaxConnectionAgeGrace: 3 * time.Minute,
Time: 1 * time.Minute,
Timeout: 15 * time.Second,
}),
Expand Down

0 comments on commit 72fd34a

Please sign in to comment.