-
Notifications
You must be signed in to change notification settings - Fork 461
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
Enable multithreading on P2P deserialization workload #4637
Conversation
_group = new SingleThreadEventLoop(); | ||
|
||
_group = new MultithreadEventLoopGroup(); |
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.
One thing that we should consider. If we do more writes during the old bodies/receipts sync, we will have more problems with attestations during that time. On the other hand, we will end up the sync faster, so not sure what is better.
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.
We can specify number of thread. Default is core count * 2.
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.
Math.Max(Environment.ProcessorCount- 2, 1)
?
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.
We can also just ask user to set less peer count if sync is too resource intensive. They would have the same problem if they set very high sync peer count anyway.
3 out of 4 smoke test failed with invalid block. Isolating pr.... |
a5d3433
to
85c035d
Compare
85c035d
to
2ad3ba2
Compare
2ad3ba2
to
4b4e496
Compare
Invalid block is probably due to the package issue. (this was in develop).
So that is disappointing. |
Mixed with #4725 and #4692 to reduce likelyhood of stuck on slow peer and maximize efficiency. 1 thread vs 8 thread. Second run have regression across the board, brobably unrelated to this PR. |
|
Another runs 1thread vs 8thread:
|
Teku was scheduled on an epyc 7601 while the rest is on epyc 7713. Which explain everything.... |
More runs when requested 16 core instance:
|
Default to CPU count - 2. No regression found after a lot of smoke tests, but usually small improvement exists when measusing whole sync time. |
Approved, but looks like current improvements are minimal? |
Unfortunately yes. |
* Make P2P handler thread count configurable * Auto set based on CPU count.
Fixes issue with old bodies download capped by unknown force.
Changes:
Types of changes
What types of changes does your code introduce?
Put an
x
in the boxes that applyTesting
Requires testing
In case you checked yes, did you write tests??
Running smoke...
Further comments (optional)
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...