-
Notifications
You must be signed in to change notification settings - Fork 287
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
Conversation
Signed-off-by: Neil Shen <[email protected]>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
By the way, is there any metric exposed from gRPC API we can use to monitor the stream/connection status, such as window size, receive buffer, etc. |
Maybe you are looking for channelz https://pkg.go.dev/google.golang.org/grpc/internal/channelz#ChannelInternalMetric |
Signed-off-by: Neil Shen <[email protected]>
/merge |
This pull request has been accepted and is ready to merge. Commit hash: e83449a
|
cdc/kv/client.go
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about 1 << 16
?
Signed-off-by: Neil Shen <[email protected]>
…shrink-grpc-window
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 2ff79b1
|
Codecov Report
@@ Coverage Diff @@
## master #2699 +/- ##
================================================
+ Coverage 55.8716% 61.1353% +5.2636%
================================================
Files 169 161 -8
Lines 20667 17916 -2751
================================================
- Hits 11547 10953 -594
+ Misses 8012 5970 -2042
+ Partials 1108 993 -115 |
In response to a cherrypick label: new pull request created: #2723. |
In response to a cherrypick label: new pull request created: #2724. |
In response to a cherrypick label: new pull request created: #2725. |
In response to a cherrypick label: new pull request created: #2726. |
What problem does this PR solve?
Note: TiCDC in the following tests includes https://github.com/pingcap/ticdc/pull/2214.
Memory usage (pause sorter)
Tested with following changes
The last image shows TiKV snapshot is holded for a long time, because CDC scan is flow controlled. Through, I doubt if it will actually happen as TiCDC sorter can always make progress.
Performance
No significant difference.
Close #2673
What is changed and how it works?
Check List
Tests
Related changes
Release note