Skip to content

[Gateway] Guild Sharding #17

Closed
Closed
@jhgg

Description

@jhgg

Guild sharding is coming soon, after we test & deploy it internally.

You'll soon be able to specify a shard in the ready packet. This will cause the gateway to operate in shard mode, which will distribute guilds between each shard. The shard key is a tuple of {shard_id, num_shards}, where shard_id is a number starting at 0 and less than num_shards. num_shards must be a number greater than 1 (having 1 as num_shards is kinda pointless as that's the default mode of operation).

In shard mode, the distribution of guilds is calculated by (guild_id >> 22) % num_shards == shard_id. Guilds that are not on your shard will not appear on the shard list, meaning they will not show up in the guilds object in the ready packet, and that you won't receive any events for guilds not on your shard. DMs will only be sent to shard_id 0. This will make processing of DMs a bit tricky on the bot side, but still possible.

Todo List:

  • Actually deploy this - @jhgg
  • Add to documentation - @b1naryth1ef Gateway Guild Sharding #31
  • Implement in airhorn.solutions as an example for reference - @b1naryth1ef
  • 2500 guild limit per shard (may be higher, but won't be lower) - will come, but will roll this one out later, as bot libs add support for sharding for larger bots. This will be enforced beginning September 30, 2016 October 10, 2016 Jan 3, 2017

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions