How much memory and CPU does a Discord bot need?

Discord bots are among the lightest programs you can host, and also among the easiest to accidentally make heavy. A simple bot runs happily on a tiny allowance, and a poorly written or very popular one can use gigabytes. Knowing what drives the cost lets you pick a plan that fits and spot a problem before it crashes your bot.

What a bot actually does

Most of the time, a bot is idle. It holds a connection open, waits for events and responds to them. Work happens in short bursts, when a member runs a command or a message arrives. So CPU use is usually low, and memory is what decides whether it fits.

What uses memory

  • The runtime itself. Node.js or Python takes a baseline amount before your code does anything. Think tens of megabytes.
  • Libraries. Discord libraries load their own code and structures.
  • The cache. This is the big one. Libraries keep servers, channels, roles, members and sometimes messages in memory so they can answer quickly. The more servers and members your bot sees, the larger the cache.
  • Your own data. Anything you store in variables, lists or maps.
  • Heavy features. Image processing, music playback, machine learning and large data handling cost far more than ordinary commands.

Rough sizing

These are starting guides, not promises, because bots differ widely:

Bot typeTypical memoryNotes
Small private bot, a few servers128 to 256 MBSlash commands only, small data
Community bot, tens of servers256 to 512 MBA database and a few features
Popular bot, hundreds of servers512 MB to 1 GBCache grows with members
Large bot, thousands of servers1 GB and upSharding is likely. See When and how to shard a large Discord bot
Music or image botsMore, plus CPUAudio and image work is heavy

Watch the real figure rather than guessing. Your panel's graph, explained in What the CPU, memory and disk numbers on your server mean, shows how much the bot actually uses.

What uses CPU

CPU stays low until something heavy happens:

  • Image and video work, such as generating pictures or resizing avatars.
  • Voice and music, which decode and send audio all the time.
  • Large loops, for example processing every member of a server in one command.
  • Regular expressions or parsing on every message in a busy channel.
  • Bad code, such as a loop that never sleeps.

A bot that shows 100% CPU while idle almost certainly has a bug.

Reducing memory use

If your bot uses more than you would like:

  1. Cache less. Most libraries let you limit what they store, for example members and messages. Keep only what you use.
  2. Request fewer intents. The Server Members and Presence intents cause libraries to hold much more data. See Discord gateway intents explained.
  3. Do not hold big data in memory. Load from your database when needed. See How to use a database with your Discord bot.
  4. Fix leaks. A list or map that only grows, such as a log of every command, will fill memory over time.
  5. Process in pieces. Handle large jobs in chunks instead of loading everything at once.

Spotting a leak

A healthy bot's memory rises when it starts, then levels off with small ups and downs. A steady climb that never levels is a leak. It will eventually reach your limit, and the bot will stop with no clear error. If the bot goes offline after hours or days with nothing in the log, that is the classic sign. Keep your bot online lists the common causes.

Choosing a plan

  1. Estimate from the table, then add some headroom, about a third.
  2. Start small, and watch the graphs for a week.
  3. Move up when memory regularly reaches the ceiling, not before.
  4. Consider what is coming. A bot that is about to be added to many more servers needs more room soon.

Paying for far more than you use does not make a bot faster. How to choose the right plan can help you judge value.

Language matters a little

Python and Node.js both work well. Node.js tends to start with a larger baseline but handles many concurrent events smoothly. Python is simpler for many people and perfectly good for most bots. Choose the one you are more comfortable with, because skilled code matters more than the language. Deploy a Node.js Discord bot and Deploy a Python bot show how to get started with either.


Still stuck? Open a ticket on Discord - run /ticket in any channel, pick a department, and include your Server ID or Invoice ID so we can jump straight in.