BotNetwork

When Discord bots need sharding

Guild thresholds, shard formula and session starts.

Guide1 min readUpdated

Why it matters

You need Discord sharding when you pass the guild limit for one process — honor Get Gateway Bot, do not shard prematurely.

Practical steps

  1. Call Get Gateway Bot and honor session_start_limit.
  2. Use official sharding formulas.
  3. Centralize rate-limit buckets per major parameter.
  4. Keep slash command registration shard-aware.
  5. Load-test presence updates separately from message handlers.

Watch out for

  • Max shards on a bot with a dozen guilds.
  • Shared mutable cache across shards without coordination.

Related comparisons and tools