#Discord Bot Clustering

1 messages · Page 1 of 1 (latest)

tiny slate
#

How would one go about clustering a discord bot in pycord

prisma steeple
#

But you need that only if you get to a lot of servers

tiny slate
#

yeah. its because my bot is approaching 10k servers and commands are starting to slow down a bit. Is there any documentation for pycord or discord.py (also works) which shows how to cluster across different machines. I

prisma steeple
#

And this

true crag
placid zinc
#

in terms of simply running the bot, start your bot and pass shard_count, which is the total number of shards that will be running on your entire bot, and shard_ids, the shards that you want the specific cluster to run

prisma steeple
prisma steeple
#

Yeah I'll have to figure some deployment strategy out for clustering

#

I'm saying for myself

tiny slate
#

So would I just launch the exact same bot with same token just providing a different shard_ids list

placid zinc
#

yeah

#

same shard_count different shard_ids

tiny slate
#

Oh that seems easy

#

Ok thanks

placid zinc
#

cache won't be for the entire bot

#

just the one cluster

tiny slate
#

Ohk so I would need a lot of ram

placid zinc
#

not necessarily

tiny slate
#

Ok

placid zinc
#

i mean like

#

the cluster will only have the data for the guilds it's running on

#

not all the guilds

tiny slate
#

Oh

#

So it's like a different bot

placid zinc
#

yeah

tiny slate
#

Ok

placid zinc
#

http routes will still work

tiny slate
#

Fair enough I could find a way to do that

placid zinc
#

there are ways to make the clusters communicate with like

#

redis n stuff

tiny slate
#

Yeah I was just thinking of using a DB

placid zinc
#

but those are a little nuts

tiny slate
#

Ig

placid zinc
#

if you go into the library internals you could override the caching methods to use smth like redis

#

but thats up to you