Discord Sharding: How Large Bots Split Their Servers
Sharding is how a large Discord bot splits its servers across several gateway connections, called shards, so that no single connection carries too many. Discord requires it once a bot is in 2,500 servers, and each server always belongs to exactly one shard.
What a shard is
A bot's live connection to Discord, the gateway, can handle only so much traffic. Past a point, one connection cannot keep up with the events from thousands of servers. Discord solves this by letting a bot open several connections and telling each one which servers it owns. Each connection is a shard.
How servers are assigned
The shard for a server comes from its ID, using a formula that divides the guild ID (after shifting off the timestamp part of the snowflake) by the number of shards and keeping the remainder. So a given server always lands on the same shard unless the shard count changes. Direct messages always go to shard 0.
The bot sends a pair of numbers when connecting: its shard number and the total shard count. Discord then only sends events for the servers that match.
When it becomes required
- Under 2,500 servers: one connection is enough.
- At 2,500 servers: Discord refuses a single connection and the bot must shard.
- Large bots usually add shards well before the limit, to spread load and memory.
Shards can run in one process or on separate machines. The second option lets one shard restart without taking down the others.
What it means for you
Mostly nothing. Members will not see a difference. The practical effect shows up in outages: if one shard goes offline, only the servers on it lose the bot, while others keep working. If your bot is offline in just your server while others are fine, that is a hint of a shard problem rather than something you changed.
Sharding also interacts with rate limits. Starting many shards at once is limited, so a big bot restarts them in batches.
Sharding and Noxyr
You do not need to configure anything for Noxyr. The status and ping page shows whether the bot is responding, and the bot offline guide lists what to check first. If you would rather run your own application with its own connection, a custom bot runs Noxyr's features under your name, and the article on hosting nodes and uptime explains how those bots are kept running.
Common questions
At how many servers must a bot shard?
Discord requires sharding at 2,500 servers. Many large bots shard earlier to spread load.
Can one server be on two shards?
No. A server always belongs to exactly one shard, chosen from its ID and the shard count.
Does sharding change anything for my members?
No. It is an internal detail. It only matters during outages, when one shard can fail without affecting others.