-
Notifications
You must be signed in to change notification settings - Fork 463
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
Add option to have multiple network processing thread #5749
Conversation
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.
Would Networking be faster if for blocks and receipts we wouldn't do a full deserialization and allocating memory, but instead use something like ReceiptsIterator
(and implement BlockIterator
) for that and then dump the bytes directly to DB? This could save CPU cycles, allocations, GC ect.
@@ -73,7 +74,7 @@ TimeSpan sendLatency | |||
// new LoggerFilterOptions { MinLevel = Microsoft.Extensions.Logging.LogLevel.Warning }); | |||
// InternalLoggerFactory.DefaultFactory = loggerFactory; | |||
|
|||
_group = new SingleThreadEventLoop(); | |||
_group = new MultithreadEventLoopGroup(networkProcessingThread); |
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.
should there be a check that if it is 1 it would spawn SingleThreadEventLoop
? Maybe it is more optimized than MultithreadEventLoopGroup(1)
?
For blocks, at least during sync, the main bottleneck is likely IO. I guess, going straight to db would reduce some CPU, but I suspect its not going to change much. For receipts, the main bottleneck is the receipt verification. I tried a custom task scheduler before and it can saturate the whole CPU suggesting some scheduling inefficiency. I doubt other part is significant. |
as receipt thing is available I will try doing it some time. |
Changes
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
Optional. Remove if not applicable.
Remarks
Optional. Remove if not applicable.