shardCreate/ShardingManager with shards: 'auto'?

Possibly a dumb question about sharding — I apologize if it is. I'm using shards: 'auto'. This is because for this specific bot, I'm only in around 40K servers and I only use around 2GB RAM. If I use a ShardingManager, and each process/worker has a MySQL connection pool using mysql2, the RAM usage increases drastically; I believe this is because it always keeps a connection open to improve performance... and MySQL reserves a lot of RAM for each connection. I end up maxing-out my VPS' 24GB. Is there an equivalent to ShardingManager.on('shardCreate', ...), or just a sharding manager in general, when using shards: 'auto'? Is there another approach you'd recommend to reduce resource usage than using shards: 'auto'? Cheers!
2 Replies
d.js toolkit
d.js toolkit2y ago
• 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.
Stev
StevOP2y ago
Cheers for the response. I'm just looking to add better logging than what I have now Right now I've got virtually no logging. Therefore, when I run into issues, it takes me more time than it should to figure out what's happening. I'd just like to log when a shard spawns or is created, how long they take before they're ready (since Client has shardReady), etc.
Want results from more Discord servers?
Add your server