How to scale smoothly?
Regarding the sharding part, here's the situation.
With num_shards = 2, I launched two local processes with shard_id: 0: [0, 2] and [1, 2].
Then I have three servers: A, B, and C.
During startup, I print out the guilds that the current Client can receive:
client.on(Events.ClientReady, (readyClient) => {
console.log(Logged in as ${readyClient.user.tag}!);
for (const [id, guild] of client.guilds.cache) {
console.log(🔹 Server: ${guild.name} | ID: ${id});
}
});
When starting [0, 2], it serves: A and B.
When starting [1, 2], it serves: C.
Then I wanted to test smooth scaling, so I set num_shards to 3.
Next, I started [0, 3], and this time it serves: A and C.
When I send a message on A, both the original [0, 2] and the current [0, 3] receive the message.
This is the observed behavior. I've gone through all the documentation, including Discord's official docs and the discord.js docs, but couldn't find any information about smooth scaling. Is there any way to achieve smooth scaling?1 Reply
- What's your exact discord.js
npm list discord.js and node node -v version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅ Marked as resolved by OP