Skip to content

Default the client-side rate limiter under Auth0's global bucket - #33

Merged
wasabii merged 1 commit into
mainfrom
fix/client-rate-under-global-bucket
Aug 10, 2026
Merged

wasabii merged 1 commit into
mainfrom
fix/client-rate-under-global-bucket

Conversation

@wasabii

@wasabii wasabii commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Problem

Verification of #32 in labs showed the remaining source of api_limit events: 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 report x-ratelimit-limit: 1000, remaining: 986 from 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_limit event per sweep.

Change

Default TokenLimit 10 → 5 and TokensPerPeriod 5 → 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 via Auth0__Operator__RateLimit__* configuration.

Testing

Full suite: 407 passed. Empirical bucket numbers taken from api_limit events and response headers on the labs tenants.

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.
@wasabii
wasabii merged commit 9e6e8de into main Aug 10, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant