ThreeMammals / Ocelot

.NET API Gateway
https://www.nuget.org/packages/Ocelot
MIT License
8.28k stars 1.63k forks source link

Rate Limiting issues in Ocelot #1975

Closed SheruGaur closed 5 months ago

SheruGaur commented 5 months ago

Rate Limit is not working when period and period timespan values are different. When we are making same value for period and period timespan then it is working for Rate limiting on configured service. In below configuration first case Rate Limiting is working and in second case Rate Limiting is not working.

  1. First Case "RateLimitOptions": { "ClientWhitelist": ["HOR777"], "EnableRateLimiting": true, "Period": "10s", "PeriodTimespan": 10, "Limit": 2 },
  2. Second Case "RateLimitOptions": { "ClientWhitelist": ["HOR777"], "EnableRateLimiting": true, "Period": "10s", "PeriodTimespan": 15, "Limit": 2 }, Please provide the solution because rate Limiting is not working as per Ocelot documentation. Please provide it is product backlog or ongoing issues.
raman-m commented 5 months ago

Thanks for reporting to us once again! But this is well-known #1590 bug ❕ And we have open PR #1592 to fix this bug. Please, be patient! We're planning to fix this bug in Annual 2023 release which dev will start soon...

As a quick fix, define PeriodTimespan value less than (or equal to) Period

raman-m commented 5 months ago

Duplicate of #1590

raman-m commented 5 months ago

And stop terrifying us with duplicated bugs ❗

Please start your contribution to the project! 🆗❔ What's your LinkedIn?

SheruGaur commented 5 months ago

Thanks, you @raman-m for update and solution. Currently I am fully occupied in my ongoing project. Sure, I will be ready to contribute to your project whenever i am free up here.

SheruGaur commented 5 months ago

@raman-m My linkdin id is Sheru Kumar Gaur

raman-m commented 5 months ago

Please watch for PR #1592 #1590 news! Closing because of duplication...