From 2af1f2426482823ba31697fd68653084301caa3a Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 28 Nov 2025 11:11:27 -0800 Subject: [PATCH] fix too many pings --- .../src/main/java/seaweedfs/client/FilerGrpcClient.java | 2 +- weed/pb/grpc_client_server.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/other/java/client/src/main/java/seaweedfs/client/FilerGrpcClient.java b/other/java/client/src/main/java/seaweedfs/client/FilerGrpcClient.java index 320a754ea..53220d45f 100644 --- a/other/java/client/src/main/java/seaweedfs/client/FilerGrpcClient.java +++ b/other/java/client/src/main/java/seaweedfs/client/FilerGrpcClient.java @@ -81,7 +81,7 @@ public class FilerGrpcClient { .flowControlWindow(16 * 1024 * 1024) .initialFlowControlWindow(16 * 1024 * 1024) .maxHeaderListSize(16 * 1024 * 1024) - .keepAliveTime(30, TimeUnit.SECONDS) + .keepAliveTime(60, TimeUnit.SECONDS) .keepAliveTimeout(10, TimeUnit.SECONDS) .keepAliveWithoutCalls(true) .withOption(io.grpc.netty.shaded.io.netty.channel.ChannelOption.SO_RCVBUF, 16 * 1024 * 1024) diff --git a/weed/pb/grpc_client_server.go b/weed/pb/grpc_client_server.go index 9caf1f511..10a2420b0 100644 --- a/weed/pb/grpc_client_server.go +++ b/weed/pb/grpc_client_server.go @@ -52,12 +52,12 @@ func NewGrpcServer(opts ...grpc.ServerOption) *grpc.Server { var options []grpc.ServerOption options = append(options, grpc.KeepaliveParams(keepalive.ServerParameters{ - Time: 30 * time.Second, // wait time before ping if no activity (match client) + Time: 60 * time.Second, // wait time before ping if no activity (match client) Timeout: 20 * time.Second, // ping timeout // MaxConnectionAge: 10 * time.Hour, }), grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{ - MinTime: 30 * time.Second, // min time a client should wait before sending a ping (match client) + MinTime: 60 * time.Second, // min time a client should wait before sending a ping (match client) PermitWithoutStream: true, }), grpc.MaxRecvMsgSize(Max_Message_Size), @@ -89,7 +89,7 @@ func GrpcDial(ctx context.Context, address string, waitForReady bool, opts ...gr grpc.WaitForReady(waitForReady), ), grpc.WithKeepaliveParams(keepalive.ClientParameters{ - Time: 30 * time.Second, // client ping server if no activity for this long + Time: 60 * time.Second, // client ping server if no activity for this long Timeout: 20 * time.Second, PermitWithoutStream: true, }))