#Long startup time
28 messages · Page 1 of 1 (latest)
• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.
Distribute shards into different processes. eg using pm2.
Iirc, Discord has a max concurrency limit for shard identifies
That might be limiting your ability to start a lot of shards at once
2000 servers can be managed by 1 shard alone, depending on what your bot does might need 2 or 3. I figure you use internal sharding? Using traditional sharding would reduce startup time pretty sure
It probably would not, actually
It has no basis to be faster given what sharding actually is
Well, since internal sharding has a hardcoded 5s delay to start the next shard it somehow has…
everything has that delay
because it isn't our random addition
discord requires that 5s between identify calls.
Clients are limited by maximum concurrency when Identifying; if they exceed this limit, the gateway will respond with an Opcode 9 Invalid Session.
max_concurrency integer The number of identify requests allowed per 5 seconds
The base concurrency is one?
it's almost always 1
the only case where it isn't is if your bot has big bot sharding
which is 150_000 servers rn
Yeahh, I was reading the docs for sharding
Imagine starting 100 shards with 5sec delay 
you don't have to imagine. that's how that works
if you have 100000 servers you really should be running code that doesn't require you to restart entire bot to update / fix something
so while annoying, yes, should be rare occurence at this scale
Got it, I'm not that good on programming
But if one day I have the opportunity to have a bot that big
It would be a nice project to work on
reloading commands and client.off exist
client.off hmmm (alias for removeListener)