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

perf(shwap/bitswap): add session pools inside Getter #3947

Merged
merged 7 commits into from
Nov 18, 2024

Conversation

Wondertan
Copy link
Member

@Wondertan Wondertan commented Nov 18, 2024

In the Robusta environment this change:

  • Improved load distribution across BN/FNs
  • Sped up sampling

Originally, I was testing Bitswap with this change but decided against including it in the patch, as it is solely an optimization. However, without this change on the rc tag, load distribution was rather strange. One LN sampled at 180/s, while all 4 others at 4/s. Adding pooling fixed the issue and resulted in all 5 LNs at about 100/s.

In Robusta enviroment this change:
* Improved load distribution across BN/FNs
* Sped up sampling

Originally, I was testing Bitswap with this change, but decided agaisnt including it in the patch, as its solely an optimization.
However, without this change load distribution was rather strange. One LN sampled at 180/s, while all other at 4/s.
Adding pools seemed to fix the issue.
@Wondertan Wondertan added the kind:misc Attached to miscellaneous PRs label Nov 18, 2024
@Wondertan Wondertan self-assigned this Nov 18, 2024
cristaloleg
cristaloleg previously approved these changes Nov 18, 2024
Copy link
Contributor

@cristaloleg cristaloleg left a comment

Choose a reason for hiding this comment

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

SGTM

@Wondertan
Copy link
Member Author

I didn't realize that sync.Pool can silently delete objects, so there is a bug - once the pool deletes a session, it's not cleaned up from the bitswap itself. Also, we don't need to create many more sessions but require a constant amount equal to a number of DASer workers, so instead, we should implement pooling over the map.

@walldiss is gonna take over that.

Copy link
Member Author

@Wondertan Wondertan left a comment

Choose a reason for hiding this comment

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

Thanks @walldiss. LGTM

walldiss
walldiss previously approved these changes Nov 18, 2024
Copy link
Member

@walldiss walldiss left a comment

Choose a reason for hiding this comment

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

approving on behalf of @Wondertan

@Wondertan Wondertan enabled auto-merge (squash) November 18, 2024 13:13
@Wondertan Wondertan merged commit b24d47f into main Nov 18, 2024
30 checks passed
@Wondertan Wondertan deleted the shwap-bitswap-session-pools branch November 18, 2024 13:56
Wondertan added a commit that referenced this pull request Nov 18, 2024
In the Robusta environment this change:
* Improved load distribution across BN/FNs
* Sped up sampling

Originally, I was testing Bitswap with this change but decided against including it in the patch, as it is solely an optimization. However, without this change on the rc tag, load distribution was rather strange. One LN sampled at 180/s, while all 4 others at 4/s. Adding pooling fixed the issue and resulted in all 5 LNs at about 100/s.

Co-authored-by: Vlad <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:misc Attached to miscellaneous PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants