Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

bandwidth rate limit #37

Open
yutongp opened this issue Apr 10, 2019 · 3 comments
Open

bandwidth rate limit #37

yutongp opened this issue Apr 10, 2019 · 3 comments
Labels
exp/wizard Extensive knowledge (implications, ramifications) required kind/enhancement A net-new feature or improvement to an existing feature

Comments

@yutongp
Copy link

yutongp commented Apr 10, 2019

seems both js: https://github.com/libp2p/js-libp2p-connection-manager and rust: https://github.com/libp2p/rust-libp2p/blob/master/transports/ratelimit/src/lib.rs have the feature to disconnect peers if they send data exceed a threshold. That is very nice feature we would like to use in the go version as well.

Is there anything equivalent in go version to block peers who send large amount of data?
If not, could you point out how to measure the bandwidth usage in go version for each peer? So we can write our own implementation of connmgr to achieve this feature.
Thanks

@raulk
Copy link
Member

raulk commented Apr 11, 2019

I’m interested in eventually turning the connection manager into a traffic shaper, and @jhiesey is researching mechanisms for proactive resource management in libp2p.

How willing would your team be to work with the community on this?

@yutongp
Copy link
Author

yutongp commented Apr 13, 2019

I’m interested in eventually turning the connection manager into a traffic shaper, and @jhiesey is researching mechanisms for proactive resource management in libp2p.

How willing would your team be to work with the community on this?

In short term, due to our timeline, we will have to apply the change on our end. In mid term and long term, since traffic priorities, global and peer rate limiting are what features we need, I think our goals are aligned with yours. It would be nice if our work can benefit the community.

We are still new to libp2p, still on the stage that we are confusing about what modules are used for what. We probably will need some help from you and some time to work on it (other higher priority stuffs may come and go). If you need this component in a tight timeline, we may not be the right group to take on it.

@jacobheun jacobheun added exp/wizard Extensive knowledge (implications, ramifications) required kind/enhancement A net-new feature or improvement to an existing feature labels Jun 26, 2020
@jacobheun
Copy link

You could work around this by tracking the bandwidth stats from metrics, https://github.com/libp2p/go-libp2p-core/blob/master/metrics/bandwidth.go, and then performing disconnects of peers who exceed this. I don't believe there is a way to throttle the connection though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/wizard Extensive knowledge (implications, ramifications) required kind/enhancement A net-new feature or improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants