-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
mvcc : WatchResponse chan of watchStream use a lot of memory space #11906
Comments
About ChanBufLen Parameter: The consumption of Once the rate of consumption is lower than the rate of production, a change event is lost. In the real world, most cases are written faster than they are consumed. Currently Conclusion:
This is a difficult choice. |
128 seems to be enough. Sometimes the consumption speed is more than the production speed. See #11906 for more detail.
I have a think about WatchResponse chanLen. Lines 518 to 548 in b0d2edf
|
@cfc4n Can we highlight this in CHANGELOG? |
version
etcd Version: 3.3.17
Git SHA: 6d80523
Go Version: go1.12.9
Go OS/Arch: linux/amd64
issue
file : mvcc\watchable_store.go line 102


NewWatchStream()
function mallocchanBufLen
lengthchan WatchResponse
, it's a very big number, and use lot of memory. there are some pictures to illustrate the problem.In
watchable_store.go
, some annotate like this:I read the code about this chan ,and found that its value does not need to be large. Each endpoint has 2-4 length is enough for buffer use.
Am I right?
The text was updated successfully, but these errors were encountered: