From ca269fa51320d1fbf7dc20bdb9f476253f35d877 Mon Sep 17 00:00:00 2001 From: Neil Shen Date: Thu, 2 Sep 2021 11:53:54 +0800 Subject: [PATCH] address comments Signed-off-by: Neil Shen --- cdc/kv/client.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cdc/kv/client.go b/cdc/kv/client.go index 6c117bafdab..92d8e5103b2 100644 --- a/cdc/kv/client.go +++ b/cdc/kv/client.go @@ -52,11 +52,16 @@ import ( const ( dialTimeout = 10 * time.Second tikvRequestMaxBackoff = 20000 // Maximum total sleep time(in ms) + // TiCDC may open numerous gRPC streams, - // with 64KB window size, 10K streams takes about 27GB memory. - grpcInitialWindowSize = 65535 // 64 KB The value for initial window size on a stream - grpcInitialConnWindowSize = 1 << 23 // 8 MB The value for initial window size on a connection - grpcMaxCallRecvMsgSize = 1 << 28 // 256 MB The maximum message size the client can receive + // with 65535 bytes window size, 10K streams takes about 27GB memory. + // + // 65535 bytes, the initial window size in http2 spec. + grpcInitialWindowSize = (1 << 16) - 1 + // 8 MB The value for initial window size on a connection + grpcInitialConnWindowSize = 1 << 23 + // 256 MB The maximum message size the client can receive + grpcMaxCallRecvMsgSize = 1 << 28 // The threshold of warning a message is too large. TiKV split events into 6MB per-message. warnRecvMsgSizeThreshold = 12 * 1024 * 1024