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

Providing from bitswap slows down the gateways over time. #5822

Closed
Stebalien opened this issue Dec 5, 2018 · 4 comments
Closed

Providing from bitswap slows down the gateways over time. #5822

Stebalien opened this issue Dec 5, 2018 · 4 comments
Labels
kind/bug A bug in existing code (including security flaws) topic/gateway Topic gateway

Comments

@Stebalien
Copy link
Member

We currently send out provider records whenever we fetch a block from bitswap. Unfortunately, when under constant load, our provider record queue can back up quite a bit. This:

  1. Slowly (over weeks) eats up gigabytes of memory.
  2. Blocks up the dialer queue. This ends up making it really hard to actually fetch content via the gateway because the gateway is busy working through a massive queue of DHT requests.

Proposed solution: In addition to all the provider record work being done in #5774, we should consider adding an option to simply disable provider records (at least for files fetched via the gateway).

@Stebalien Stebalien added kind/bug A bug in existing code (including security flaws) topic/gateway Topic gateway labels Dec 5, 2018
@michaelavila
Copy link
Contributor

@Stebalien is the proposal to allow the daemon to run in such a way that provider records are not created/announced specifically when fetching? Does that mean we want to continue to create/announce provider records when doing add like things in that daemon?

@Stebalien
Copy link
Member Author

That's my thinking but I haven't thought through it fully. This would also be fixed by:

  1. Having an option to turn off providing globally.
  2. Obeying reprovider strategies on provide as well and configuring the gateway with a "pin-only" provider strategy.
  3. Reducing the number of blocks we end up providing and making providing "lazy" (that is, write down somewhere, e.g. in a database, that we want to provide some block and then work through the provider backlog as a background idle task).

(in order of increasing complexity)


Really, I just filed this issue to track the issue (so we can keep track of what's currently killing our gateways 😞).

@michaelavila
Copy link
Contributor

Understood. It's closely related to what I'm doing so I want to at least have it in mind. Thanks.

@Stebalien
Copy link
Member Author

This has been fixed. We still have the large queue but it's manageable and we've reduced the number of workers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) topic/gateway Topic gateway
Projects
None yet
Development

No branches or pull requests

2 participants