performance concerns regarding presence_update

Hello, I track online/total member counts. How many events a second should i throw at a shard? It's super vague, but hoping there's a general range I can follow
9 Replies
d.js toolkit
d.js toolkit2w ago
Dawson
DawsonOP2w ago
I'm only monitoring around 100k users at the moment, and I am not struggling with performance as far as I can tell. Just curious at what point I should actually start sharding
d.js docs
d.js docs2w ago
Getting your bot's member count - client.users.cache.size is unreliable because it will only return cached users - The preferred method is using collection.reduce() on client.guilds.cache
client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)
client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)
Amgelo
Amgelo2w ago
don't need presences for total members you do for online though, but I'm not sure what you mean with "How many events a second should i throw at a shard"
Dawson
DawsonOP2w ago
I track actively online members a live count I am just curious how many events a single discord shard can handle
Amgelo
Amgelo2w ago
well that's just limited by your resources there's no real way to tell except in production from your own performance metrics
Dawson
DawsonOP2w ago
What about just the most average kind of server out there I can get the exact specs if needed I don't need anything too specific, just like, 100, 5k, 10k
Amgelo
Amgelo2w ago
there's no formula for that, it's just a matter of resources pretty much, maybe someone with big bots can tell you an average of events per guild but that wouldn't mean your resources can (or can't) handle that
Dawson
DawsonOP2w ago
Alright, thank you

Did you find this page helpful?