Skip to content
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

Feature/bodies and receipts request sizer #5994

Merged
merged 21 commits into from
Aug 14, 2023

Conversation

asdacap
Copy link
Contributor

@asdacap asdacap commented Aug 10, 2023

  • Besu and reth does not seems to have soft limits on their bodies and receipts message, meaning we may receipt messages up to 20MB in size. For reference, geth and nethermind send up to 3MB only.
  • This is not great as larger message are harder to pool by dotnetty, which may allocate more memory to create more arena. (default arena size is 32MB with the default 2GB memory budget).
  • Also, they tend to timeout as they are trying to send very large message.
  • This PR add a per-peer request sizer, which adjust the requests size of get block body and get receipts so that it will reduce the request size if previous request take too long or is too big.
  • This reduces 99p size of block body and receipt from about 20MB to 8MB, which seems to eliminate very large memory allocation when connecting only to besu.

Screenshot_2023-08-10_18-20-59

Changes

  • Add a request sizer which changes body and receipt request size.

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • Optimization

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Requires explanation in Release Notes

  • Maybe?

Slightly reduce memory allocation during old bodies and receipts.

@asdacap asdacap marked this pull request as ready for review August 10, 2023 12:30
Copy link
Member

@LukaszRozmej LukaszRozmej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor improvements

@asdacap asdacap merged commit 7627fdb into master Aug 14, 2023
61 checks passed
@asdacap asdacap deleted the feature/bodies-and-receipts-request-sizer branch August 14, 2023 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants