Discord Bot Sharding and Scaling
When your bot grows beyond 2,500 guilds, Discord requires you to implement sharding to divide network connections across process instances.
1. Overview of Sharding
A shard represents a distinct connection to the Discord Gateway. Each shard manages a slice of your total assigned servers.
2. Configuring Startup Scripts
- Create your shard entry file in the root directory.
- Open the Startup tab in your CordenX panel.
- Update the entry file setting to point to your sharding file.
- Restart your server from the Console tab.
3. Recommended Resource Allocations
- 0 to 2,500 Guilds: 1 Shard | 512 MB to 1 GB RAM
- 2,500 to 10,000 Guilds: 3 to 5 Shards | 2 GB to 4 GB RAM
- 10,000+ Guilds: 10+ Shards | 8 GB+ RAM