-
Notifications
You must be signed in to change notification settings - Fork 72
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
Retrieval API Based Filter Configs #1020
Conversation
provide a simple tool for a time window'd measurement of bandwidth
add additional configs for the peer filter, update interfaces
implement bitswap setup between go-bitswap PR + other changes to support full configs
rename peer filter to remote config filter
69e1b90
to
044ddd7
Compare
0fd7a9e
to
7c341f9
Compare
I'd suggest we add a version field to the config API structure |
Remove need for custom bitswap while providing a more correct simultaneous request limit
@dirkmc for HTTP I tend to expect versioning to be in:
Maybe we can discuss this as a seperate ticket between now and final release. |
closed in favor of #1030 |
I'd suggest we keep this pull request open until it's approved. It makes it easier to discuss the PR. I'm not sure that checking wantlists and sent messages (block / have / dont-have) exactly maps to "simultaneous requests". For example in certain circumstances if the server doesn't have a block it simply doesn't respond. The problem is that bitswap is not a request / response protocol. For this reason it may not make sense to have a limit on the number of simultaneous requests. If the goal is to make sure that one peer doesn't hog all the resources, bitswap is already designed to distribute blocks in a manner that is fair to all peers. So I'd suggest we just drop the simultaneous requests limits (but keep the bandwidth limit). Because bitswap is not a request / response protocol, and because the client can send a request for many blocks in a single message, I'm not sure that it makes sense to reject requests because of bandwidth limits. I'd suggest that we don't reject requests at all - instead we could limit the data rate at which bitswap serves blocks so that it doesn't hog all the server's resources. As mentioned above, bitswap already has mechanisms to make sure that each peer is served its fair share of data, so this is more about preventing bitswap from crowding out other retrieval endpoints (eg graphsync). It may make more sense to implement bandwidth rate-limiting at the libp2p level, as libp2p has knowledge of how much data each protocol is sending, without needing to know about the implementation of the protocol itself. |
With respect to versioning, I'm not sure I was clear in what I suggested. Copying from the PR description, the api structure is now as follows:
I'm suggesting we add a version field to this structure, so that if (for example) we add "Graphsync" to "StorageProviderLimits" we can update the version, and it's easier for the process that parses this structure to understand which fields are expected. |
|
Bitswap is designed to handle this use case - because it operates in a peer-to-peer environment, it needs to be resilient to getting spammed by a single peer. Essentially it will distribute blocks evenly amongst peers, so that no one peer can clog up the queue.
I understand that SPs want to limit resource usage, that makes sense 👍 I realize that's going to take time, so I suggest we punt on this requirement. Let's start testing booster-bitswap with SPs and work on bandwidth limiting in the mean time. |
To clarify about simultaneous requests, the correct phrasing should be "simultaneous TCP connections". So it's not based on a per request, but more per simultaneous TCP active connection.
What SP wants to protect themself from :
|
Thanks Julien, that makes sense 👍 |
OK that's helpful, we can certainly use this metric instead, and it's much simpler so that's great. It's worth noting that currently the ConnManager won't let you change limits after its constructed, so a change on CIDGravity wouldn't take effect until you reboot booster-bitswap, unless we made a change in go-libp2p's conn manager. It also won't work the way you expect if you run booster bitswap proxied through boostd. Connection limiting then is just boostd's job. The same issues apply for the resource manager if we went that route. (only sets limits at startup, won't work the way you expect in proxied mode) We can maybe doing this implementing a ConnectionGater instead if we want limits that change while running?
Ok, so we can certainly explore doing it through libp2p but it looks like a longer discussion that will take a while based off some early convos with the libp2p folks. The alternative is just to block the MessageSent hook I'm using already to limit bandwidth. It's an indirect approach but it has a much shorter implementation path. In fact, we use this exact approach to backpressure selector execution flow in go-graphsync, so I'm pretty sure there's some code I can copy that will do almost exactly what we want. |
I think something like the connection gater approach sounds good 👍 Blocking the message sent hook sounds like a bit of a hack.. |
I mean, I'm not sure what would be wrong with blocking the message sent hook. It would work. again -- we use these mechanisms in graphsync. |
Also though, another option is to simply tell SPs who care to put boost on a public node and configure bandwidth usage on a firewall. |
Closing pending future discussion |
Goal
Per ongoing discussions with @s0nik42, we're updating the endpoint that previously transmitted peer allow/deny lists to send additional agreed upon configuration for retrieval.
The api structure is now as follows:
Implementations
For Discussion
Blocked on #994 , ipfs/go-bitswap#596