Microsoft Technologies based on the .NET software framework. Miscellaneous topics that do not fit into specific categories.
Hi @Arjun J ,
Thanks for reaching out.
Looking at your setup and test, here’s what’s happening:
With your token bucket configuration:
- TokenLimit = 5
- TokensPerPeriod = 3
- ReplenishmentPeriod = 2 minutes (or 1 minute in your other test)
…and your test loop of 50 requests with 100ms between requests, the entire run only takes around 5 seconds. That’s much shorter than either replenishment period, so no tokens should be replenished during this test.
This means that any requests after the first 5 returning 200 are not caused by normal token replenishment. Likely causes include:
- The requests may not all be using the same authenticated identity.
- The tested endpoint may not always be hitting the same rate-limited path or policy.
- Another client or request source may be affecting what you observe.
If you’ve verified that the same userId is used for every request, it would be helpful to log the actual partition key and confirm that the same policy is applied on every request. This can help identify if some requests are bypassing the per-user limiter.
Hope this helps! If my answer was helpful, I would greatly appreciate it if you could follow the instructions here so others with the same problem can benefit as well.