dshackle icon indicating copy to clipboard operation
dshackle copied to clipboard

Upstream rate limiting

Open splix opened this issue 5 years ago • 3 comments

Allows to setup rate limiting per upstream. If there are more requests that allowed, then Dshackle should wait for finishing one of the existing before making a new request to that upstream.

splix avatar May 25 '20 22:05 splix

We've had a good experience so far with Bucket4j using an embedded Infinispan cache. This dove tails nicely with distributed caching without needing to run a separate service such as Redis.

brianmcgee avatar Oct 20 '21 13:10 brianmcgee

I'm not familiar with the Bucket4j but I guess it could work. Dshackle already has a support of Redis for caching, so using Redis should align well with the current code. Using the Infinispan maybe a good idea too, but that would require much more work.

Btw, rate limiting is not so critical with current master branch, because now it uses WebSocket for RPC which handles spikes of requests to an upstream much better. Still an issue with Bitcoin nodes though.

splix avatar Oct 20 '21 15:10 splix

Bucketing is generally straightforward, probably a few examples out there for Redis. Makes sense to avoid adding the extra complexity of Infinispan at this stage, would be cool to see later though.

brianmcgee avatar Oct 20 '21 16:10 brianmcgee