Hosting and Capabilities

:arrow_right:At the moment. Me and My Friends are developing a bot called MegaBot. And when released its going to be a big hit! and all i am wondering if we did have loads of servers 1000+ would glitch cope with that amount or more. and i can notice on the stats. the CPU etc keeps going up and down. is glitch, strong enough for big bots, or is it suggested to change host? :arrow_left:
To staff who know about this stuff.

First off, is this bot guaranteed to be in 1000+ servers immediately?

If it’s not in a lot of servers >100 a Glitch container should be fine.

If your bot is going to be in 2,500+ servers you need to use sharding. Glitch won’t be able to handle sharing (correct me if I’m wrong) due to projects go offline every 12hrs.

The best option if your bot is going to be in 1000+ servers is look for a paid host (these won’t be cheap as you’ll need good specs and you need multiple ones for sharding) or run the bot locally. If your running locally I’d suggest using a Raspberry Pi to start off with (it’s only £35!) then you can turn it into a cluster to do sharding (if you wish).

1 Like

My bot is 2100+ guilds :slight_smile: statistics are here:
bot1
guilds
(ps: the bot restarts every 5 minutes)

1 Like

You need to shard. Sharding probably won’t work on Glitch at all due to project restarts.

You either need to go with a paid hosting provider (cheap ones don’t always work!) or run it locally, as I mentioned above. Free hosts won’t be able to cope with that many servers.

Hey @flashmaster303 as others have said I suspect a bot in that many guilds is probably going to stretch the limits of a Glitch container, and as a result may restart regularly when it runs out of resources.

I think there are a few folks who have user sharding on Glitch, but honestly I don’t know much about it, so I’m not a great person to ask. I’m moving this topic to the Discord Help category to see if any other bot authors have input for you.

1 Like

I have one bot in 7k-8k servers and it never goes online because of exceeding memory usage.

I just shared it for the show. It needs the shard, but the Glitch project is getting tired.

Sharding uses multiple servers (in this case Glitch projects) to do sharding successfully you either need multiple servers with good specs (quite a bit of ram & fast processor/CPU/vCPU) OR you run your own hardware at home, etc. Glitch isn’t designed for memory-intensive projects.

Add me on discord! Flash#3690 if you want to chat and partner up. :slightly_smiling_face:

Add me on discord! Flash#3690 if you want to chat and partner up.

I will have to see :slight_smile:

you can just run the bot in more then 1 container.

Dont know if this is still relevant but it is totally possible, even with sharding. You just have to cache way less things, my friend runs a bot with over 10k guilds and his bot uses around 200mb memory with lots of adjustments to the cache (running discord.js)

If you’re not willing to dig that deep (modifying cache) then you shouldn’t run a discord bot that big in the first place, but you should host the bot somewhere else than glitch in the first place

Modifying the cache is not required. Only a handful of bots modify the cache, and it’s not fully supported in Discord.js anyway. Modifying the cache can also negatively impact your bot if you reduce the cache you could possibly loose out on features like emojis and possible message loss (if your memory fills up).

Of course. You limit the cache based on what features your bot needs. An external module i made handles my cache, which includes removing channels from cache if they are unused, which isn’t an issue since discord sends enough data in events anyway to repopulate the cache, and you may always fetch additional data if required from discord API. People who started programming like a month ago shouldn’t even attempt this, but as an advanced implementation to reduce memory it’ll do, since d.js refused to lower the cache amount or add settings to do so. Discord js uses a lot of memory because of unnecessary caching, unlike eris. You may ask “why not use eris”. I don’t have much experience with the eris library and I’d rather be using a library I proficiently understand. If your bot is large and you have no intention or skill to implement this to keep your bot running, you might aswell delete the bot because you don’t have the skill to run it efficiently.

What is the package name that you mention?

I’ve mentioned 2, which one?

This part of your speech.

“module” doesn’t always mean it’s public. It handles the cache for my bots, including very memory intensive bots. It replaces d.js cache collections with specially modified ones to either prevent caching, or keep it clean. It’s closed source (may make it public) however my friend made a module which is public for this, he uses it for his other bots with minimal memory usage despite guild amounts. I can send a link if you desire.