Ocelot icon indicating copy to clipboard operation
Ocelot copied to clipboard

Global rate limiting for all, multiple routes instead of every route

Open neetra opened this issue 4 years ago • 6 comments

Expected Behavior / New Feature

Add rate limit options for all requests in common

{
  "Routes": [],
  "RateLimitOptions": [
    {
      "RouteKeys": [ "posts", "users" ],
      "ClientWhitelist": [],
      "EnableRateLimiting": true,
      "Period": "10s",
      "PeriodTimespan": 3,
      "Limit": 1     
    }
  ]
}

Actual Behavior / Motivation for New Feature

We add rate-limiting options for every route : For e.g:

{
  "DownstreamPathTemplate": "/users",
  "DownstreamScheme": "https",
  "DownstreamHostAndPorts": [
    {
      "Host": "jsonplaceholder.typicode.com",
      "Port": 443
    }
  ],
  "UpstreamPathTemplate": "/users",
  "UpstreamHttpMethod": [ "Get" ],
  "RateLimitOptions": {
    "ClientWhitelist": [],
    "EnableRateLimiting": true,
    "Period": "10s",
    "PeriodTimespan": 3,
    "Limit": 1
  }
}

neetra avatar May 11 '20 06:05 neetra

Any progress on this issue please let me know i am kind of waiting to apply ratelimiting time globally.

ZainHaiderArif avatar Feb 07 '24 15:02 ZainHaiderArif

@ZainHaiderArif It is better to contribute, but not to wait ☝️

Our team (me, @RaynaldM, @ggnaegi) capacity is low and we work on more important issues (performance, a brand new features). But I hope we will work on this feature soon.

And for now, global Rate Limiting feature is available for Dynamic Routing 👉

raman-m avatar Feb 23 '24 14:02 raman-m

Related issues

  • #1915
  • #585

raman-m avatar Feb 23 '24 14:02 raman-m

@neetra Hi Netra! Are you with Ocelot nowadays?

raman-m avatar Feb 23 '24 15:02 raman-m

Dear @neetra, Did you read this :point_right: Global Configuration :question:

raman-m avatar Jun 15 '24 11:06 raman-m

Global Rate Limiting configuration is already implemented!

raman-m avatar Jun 15 '24 11:06 raman-m

You have the right to reopen this issue in the future if you come with a PR ready

raman-m avatar Jun 15 '24 11:06 raman-m