You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sharding can be implemented in multiple stages. I think Stage 1 is all that is required to become an official discord lib
Stage 1. Accept EC_SHARD_ID and EC_SHARD_NUM as environment variables and send these to Discord. The user deploying the bot is responsible for configuring each instance of the bot correctly. Stage 1 Sharding #120
Stage 2. Connect to the Get Gateway Bot endpoint to retrieve the recommended number of shards. Based upon that result setup N shards per host. For example, with EC_SHARD_NUM=2 and a recommendation of 5 shards from the endpoint, host 1 would connect as shards 0,1,2, with host 2 connecting as shards 3,4.
Stage 3. Using a shared/clustered data store determine how many instances of the bot are running to work out EC_SHARD_NUM and EC_SHARD_ID automatically. Then setup N shards per host as per step 2.
Stage 4. Automated shard addition and removal. Using the data store as in Stage 3 monitor factors that could affect the number of shards we need to have. e.g., the recommendation from discord, the number of hosts running, hosts going down etc.
The text was updated successfully, but these errors were encountered:
https://discordapp.com/developers/docs/topics/gateway#sharding
Sharding can be implemented in multiple stages. I think Stage 1 is all that is required to become an official discord lib
EC_SHARD_ID
andEC_SHARD_NUM
as environment variables and send these to Discord. The user deploying the bot is responsible for configuring each instance of the bot correctly. Stage 1 Sharding #120EC_SHARD_NUM=2
and a recommendation of 5 shards from the endpoint, host 1 would connect as shards 0,1,2, with host 2 connecting as shards 3,4.EC_SHARD_NUM
andEC_SHARD_ID
automatically. Then setup N shards per host as per step 2.The text was updated successfully, but these errors were encountered: