-
Notifications
You must be signed in to change notification settings - Fork 587
High CPU Utilization from Gossip Fix #1315
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
base: main
Are you sure you want to change the base?
Conversation
{ | ||
conn = null; | ||
if (_disposed) return false; | ||
for (var i = 0; i < numConnection; i++) |
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.
Understanding the reason behind the connections being an array instead of something like a ConcurrentDictionary. Is it because the number of connections is expected to be significantly low to impact the search?
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.
I feel that access should be pretty fast if the number of items is in the order of 100s - 1000s. The other issue is empirically we found that ConcurrentDictionary not being that performant. I guess since gossip is not on the critical path it should be fine. Last thing using our own lock gives us the ability to favor Readers (accessing connection stats) over Writers (adding a new connection). We can probably get away with that if we use regular Dictionary with our lock.
Is it possible to provide a repro that demonstrates high CPU utilization so we can profile somehow the different options?
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.
I see that paddy has already mentioned similar concern on the issue. #1299 (comment)
bba9652
to
6642378
Compare
WIP