Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kv: reduce gRPC window size to avoid OOM #2699

Merged
merged 8 commits into from
Sep 2, 2021
8 changes: 4 additions & 4 deletions cdc/kv/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ import (
const (
dialTimeout = 10 * time.Second
tikvRequestMaxBackoff = 20000 // Maximum total sleep time(in ms)
// TODO find optimal values and test extensively before releasing
// The old values cause the gRPC stream to stall for some unknown reason.
grpcInitialWindowSize = 1 << 26 // 64 MB The value for initial window size on a stream
grpcInitialConnWindowSize = 1 << 27 // 128 MB The value for initial window size on a connection
// 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

// The threshold of warning a message is too large. TiKV split events into 6MB per-message.
Expand Down