Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2022-08-04 13:17:58 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-08-04 13:17:58 +0300
commit993d944ebeea3e0ec8157481f125f9c70161ae4a (patch)
treed5cd9437beaff84447b7314a4f15bb26d62a6be0
parent3d769a33712796de113fe07647597a63d762c305 (diff)
parent6a02746cd6edc7d3e87e8c340ad271e8859b4956 (diff)
Merge branch 'wc-reduce-min-keepalive' into 'master'
server: Give clients grace-period for keepalives Closes #4397 See merge request gitlab-org/gitaly!4772
-rw-r--r--internal/gitaly/server/server.go6
-rw-r--r--internal/praefect/server.go6
2 files changed, 10 insertions, 2 deletions
diff --git a/internal/gitaly/server/server.go b/internal/gitaly/server/server.go
index 2aad1ad74..e62b4b99c 100644
--- a/internal/gitaly/server/server.go
+++ b/internal/gitaly/server/server.go
@@ -156,8 +156,12 @@ func New(
grpc.Creds(lm),
grpc.StreamInterceptor(grpcmw.ChainStreamServer(streamServerInterceptors...)),
grpc.UnaryInterceptor(grpcmw.ChainUnaryServer(unaryServerInterceptors...)),
+ // We deliberately set the server MinTime to significantly less than the client interval of 20
+ // seconds to allow for network jitter. We can afford to be forgiving as the maximum number of
+ // concurrent clients for a Gitaly server is typically in the hundreds and this volume of
+ // keepalives won't add significant load.
grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{
- MinTime: 20 * time.Second,
+ MinTime: 10 * time.Second,
PermitWithoutStream: true,
}),
grpc.KeepaliveParams(keepalive.ServerParameters{
diff --git a/internal/praefect/server.go b/internal/praefect/server.go
index f2bc6a380..3192ddfdd 100644
--- a/internal/praefect/server.go
+++ b/internal/praefect/server.go
@@ -128,8 +128,12 @@ func NewGRPCServer(
auth.UnaryServerInterceptor(conf.Auth),
)...,
)),
+ // We deliberately set the server MinTime to significantly less than the client interval of 20
+ // seconds to allow for network jitter. We can afford to be forgiving as the maximum number of
+ // concurrent clients for a Gitaly server is typically in the hundreds and this volume of
+ // keepalives won't add significant load.
grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{
- MinTime: 20 * time.Second,
+ MinTime: 10 * time.Second,
PermitWithoutStream: true,
}),
grpc.KeepaliveParams(keepalive.ServerParameters{