Repository navigation
Default the client-side rate limiter under Auth0's global bucket - #33
Merged
Merged
Conversation
Auth0 enforces a tenant-wide global bucket across all Management API endpoints combined — as small as 10 requests of burst with 150/minute sustained on self-service plans — and unlike the per-endpoint buckets it is never reported in response headers, so adaptive pacing cannot see it depleting. The previous defaults (burst 10, 5/second sustained) emptied that bucket on every cold reconcile sweep before pacing had any data, producing an api_limit event per sweep. Default to burst 5 and 2/second (120/minute) so the operator alone can never drain the global bucket, leaving headroom for the dashboard and other consumers; tenants on larger plans can raise the limits via configuration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Verification of #32 in labs showed the remaining source of
api_limitevents: Auth0 enforces a tenant-wide global bucket across all Management API endpoints combined ({"limit": {"size": 10, "global": true}}in the tenant log events; 150/minute sustained on self-service plans). Unlike the per-endpoint buckets, the global bucket is never reported in response headers — a read can reportx-ratelimit-limit: 1000, remaining: 986from its endpoint bucket while the size-10 global bucket is empty — so the adaptive pacer cannot see it depleting.The client-side token bucket defaulted to burst 10 at 5/second: the cold-sweep burst of 10 alone empties Auth0's size-10 global bucket instantly whenever pacer budgets have gone stale, producing one
api_limitevent per sweep.Change
Default
TokenLimit10 → 5 andTokensPerPeriod5 → 2 (120/minute, under the 150/minute global refill), with doc comments explaining the invisible global bucket. The operator alone can now never drain the global bucket, and headroom remains for the dashboard and other API consumers. Tenants on plans with higher limits can raise both viaAuth0__Operator__RateLimit__*configuration.Testing
Full suite: 407 passed. Empirical bucket numbers taken from
api_limitevents and response headers on the labs tenants.