Announcing rateguard 0.6: distributed rate limiting with no Redis and no network call on the request path
The Rust Programming Language Forum
Announcing rateguard 0.6: distributed rate limiting with no Redis and no network call on the request path
Hi everyone! I'd like to share rateguard, a crate for enforcing one global rate limit across a fleet of service instances, without a shared datastore. use rateguard::Guard; let guard = Guard::builder() .bind("0.0.0.0:7946") .advertise("10.0.0.3:7946") .seeds(["10.0.0.1:7946", "10.0.0.2:7946"]) .limit(1_000) // 1000 rps per key, across every instance .spawn()?; if guard.check("api:tenant-42").is_allowed() { serve(request) } else { too_many_requests() } Why The usua...
0 comments
No comments yet.