-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
bitswap/client: configurable broadcast reduction #10825
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
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.
Looks sensible, small asks
- produce some synthetic benchmark (e.g. in Staging) that shows N% bandwidth reduction over time T without meaningful success decrease
- make all these new knobs optional in JSON and have implicit defaults as consts (details inline)
78180e6
to
60ad658
Compare
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.
My main question is whether this can auto-break discovery in private networks. Technically, they still have DHT so we should be fine? It might be problematic if a peer has added content, but not provided it on the DHT. Other peers in the private network might not discover it via bitswap in order to copy it.
Thinking of IPFS Clusters for example, even when Kubo is on the public network, cluster-peers ensure their kubos are connected to the other peers' kubos via swarm/connect
. These connections are protected in Kubo with Weight = 100. A new cluster peer will be able to get any blocks it needs to replicate from a different cluster peer thanks to bitswap, rather than hitting the DHT. This might stop working now unless blocks are announced to the DHT, as even if we are on a protected connection, there is guarantee that we will broadcast wants to a peer that has not given us blocks before.
Might we consider broadcasting to protected connections?
docs/config.md
Outdated
#### `Internal.Bitswap.BroadcastReductionEnabled` | ||
|
||
Enables or disables broadcast reduction logic. If broadcast reduction logic is disabled, then the other Broadcast configuration items are ignored. Setting this to false restores previous broadcast behavior. |
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 would like this to expand with more info:
- What is the broadcast reduction doing?
- What scenarios benefit from having this on/off? Particularly, discovery might stop working for small private networks that rely on bitswap broadcasts right?
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.
Added in section Internal.Bitswap.BroadcastControl
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.
might stop working for small private networks
If the networks are private, then default settings will broadcast to all the peers with private addresses. So no breakage expected in this case.
It may be beneficial to disable broadcast control in cases where there is no routing and discovery of blocks relies on asking all peers. If that really something to document?
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.
Added: "Enabling broadcast control should generally reduce the number of broadcasts significantly without significantly degrading the ability to discover which peers have wanted blocks. However, if block discovery on your network relies sufficiently on broadcasts to discover peers that have wanted blocks, then adjusting the broadcast control configuration or disabling it altogether, may be helpful."
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.
If the networks are private, then default settings will broadcast to all the peers with private addresses. So no breakage expected in this case.
Sorry, by "private", I didn't mean peers with private addresses, I mean peers with public addresses that form a "pnet" private-network.
aaf54bd
to
c0cb857
Compare
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.
lgtm, pushed small fix & surfaced gains in changelog.
- switch to boxo release before merging
Add new config items to `Internal.Bitswap` to allow configuration of bitswap broadcast reduction behavior. Broadcast reduction behavior is enabled by default, and uses settings that should be suitable for most installations of kubo.
Co-authored-by: Hector Sanjuan <[email protected]>
db2c629
to
e900d37
Compare
Add new config items to
Internal.Bitswap
to allow configuration of bitswap broadcast reduction behavior. Broadcast reduction behavior is enabled by default, and uses settings that should be suitable for most installations of kubo.Results
For all the following results, there was not a significant drop in the number of want-have responses or unique blocks received for the hosts with broadcast reduction enabled compared with the hosts with broadcast reduction disabled.
During stable operation
Broadcast rates:
(5x reduction) -- 80% broadcast reduction
Transmit bandwidth
(50% transmit traffic reduction)
During increasing traffic
Broadcast rates:
(11x reduction) -- 98% broadcast reduction
Transmit bandwidth
(80% transmit traffic reduction)
During spike in peers
Broadcast rates:
(58x reduction) -- 98% broadcast reduction
Transmit bandwidth
(95% transmit traffic reduction)
Additional data points: