🎉 Launch offer: the next 5 servers get 30 days free. Claim a spot →
All topics & search

Guide/Protect your server/Capacity: what happens when several servers are hit at once

Capacity: what happens when several servers are hit at…

What happens when several servers are attacked at once: the two request ceilings and why security goes first.

Ask the guide

Step by step

The limit is Discord's, not the machine's

A bot token gets roughly 50 requests a second in total, across every server it is in. That, not CPU or memory, is what decides how fast a raid can be contained — which is also why hosting the bot closer to anything does not speed this up.

Two ceilings

SettingDefaultWhat it controls
CONTAIN_CONCURRENCY15Accounts acted on at once while containing one cohort. Discord’s per-guild buckets throttle this anyway.
CONTAIN_CONCURRENCY_GLOBAL25The most in flight across every server at once, leaving room for ordinary commands while a raid is running.

The second one is the one a single limit misses. Four servers raided together, each running flat out, would spend the entire token budget on bans — and slash commands have a hard three-second deadline, so the cost would be every other server's commands timing out.

Security goes first

The budget is shared with work that can afford to wait: syncing quarantine permissions channel by channel, restoring a backup. That work runs at the lowest priority and yields the moment a raid needs the budget, rather than competing first-come-first-served and winning simply because it started earlier.

Sharding

Set REDIS_URL and the global ceiling is counted in one place instead of once per process — without it, four shards each allowing 25 in flight is really 100, because the rate limit belongs to the token rather than to a process. Redis also lets shards share the AI verdict cache, so the same message is judged once rather than once per shard. Everything works without it; a single-process deployment needs no Redis at all, and if Redis goes away mid-raid the containment carries on under the local limit.

Good to know

  • These are environment variables set by the operator, not per-server settings.
See also:REST API

Still stuck? Ask in the support server.

Capacity: what happens when several servers are hit at… · Sweet