AspNetCoreRateLimit icon indicating copy to clipboard operation
AspNetCoreRateLimit copied to clipboard

DR/Resilience when using Distributed Cache

Open oatsoda opened this issue 6 years ago • 3 comments

I'm using Redis as the distributed store for rate limiting, but I'd like to know if there is anything in AspNetCoreRateLimit, or any plans to add anything to enable some kind of resilience.

At the moment it appears that should Redis be unreachable (for whatever reason) then my Web App is offline.

It would be really nice if there could be the ability to fall back gracefully - either to Memory Rate limiting, or just No Rate limiting at all.

Thoughts:

  • Configurable
  • Perhaps a static memory level switch that is set when a Redis exception occurs, which turn the Web App Rate Limit OFF for a period of time, or reverts to Memory Rate limiting
  • Ability to specify a fallback Redis connection string (I guess this really comes under the Microsoft.Extensions.Caching.Redis rather than AspNetCoreRateLimit)

oatsoda avatar Apr 19 '18 13:04 oatsoda

Try to use services.AddDistributedRedisCache

https://github.com/stefanprodan/AspNetCoreRateLimit/issues/27

RouR avatar Nov 01 '18 17:11 RouR

@RouR Yes, I am already using that. If you see in #27, it was actually me who answered the question :)

oatsoda avatar Nov 02 '18 08:11 oatsoda

@oatsoda I am wondering about the same issue. Did you resolved your issue? I thought about implementing custom rateLimitStore, something similar to the Solution2 mentioned here: https://github.com/stefanprodan/AspNetCoreRateLimit/wiki/Using-Redis-as-a-distributed-counter-store but it never gets called

manisha201301 avatar Jul 28 '21 16:07 manisha201301