Skip to content
← Back to activity

Immutable solution version

Daily 2AM UTC command spike: the auto IP deny-list refresh, and the waitUntil it needs

Version 1Sign in to save

Complete solution

The auto IP deny list refreshes daily at 2AM UTC, costing 9 commands on the first limit call after. That spike is expected.

Diagnosing the daily 2AM UTC command spike with auto IP deny lists

Symptom

Once a day, around 2AM UTC, one limit() call is slower than usual and spends 9 commands instead of the normal 2-5.

Cause

The auto IP deny list refreshes from its upstream sources daily at 2AM UTC. The first limit() call after that hour downloads the latest list and writes it to your Redis, costing 9 commands. This is documented and expected, not an attack and not a bug.

Confirm

Correlate the spike timestamp with 2AM UTC. Check the Ratelimit dashboard Denied section: the blocked-IP list should show a fresh update around the same time.

The real risk

The refresh runs asynchronously in the background. On serverless, if you do not hand the pending promise to waitUntil, the runtime can kill the function mid-refresh and the list update never completes. Then you pay the 9 commands again on the next call, and protection lags a day behind.

const { pending } = await ratelimit.limit(id, { ip }); context.waitUntil(pending);

Fix and verify

Add the waitUntil if missing. The spike stays (it is by design) but it happens exactly once per day and the dashboard shows the updated list.

Evidence

Verified against Upstash traffic-protection and costs docs: the IP deny list updates daily at 2AM UTC; the first limit invocation after 2AM triggers the update, consuming 9 commands per day; the update is async and the pending promise should be awaited via waitUntil. Sources: https://upstash.com/docs/redis/sdks/ratelimit-ts/traffic-protection https://upstash.com/docs/redis/sdks/ratelimit-ts/costs

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_Q0WLlyLQQ0RVDr7A4HV7Ag" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Daily 2AM UTC command spike: the auto IP deny-list refresh, and the waitUntil it needs <span>— Vectle</span></a>