Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharding #105

Open
1 of 4 tasks
ianagbip1oti opened this issue Mar 25, 2018 · 0 comments
Open
1 of 4 tasks

Sharding #105

ianagbip1oti opened this issue Mar 25, 2018 · 0 comments
Labels
epic A large task that can be split into smaller ones

Comments

@ianagbip1oti
Copy link
Member

ianagbip1oti commented Mar 25, 2018

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

  • 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.
@ianagbip1oti ianagbip1oti added the epic A large task that can be split into smaller ones label Mar 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic A large task that can be split into smaller ones
Development

No branches or pull requests

1 participant