How much RAM is required for Discourse?

Hi,

I’ve recently installed Discourse on my own VPS. I have only 2 GB of RAM. Is this sufficient to run a forum in production? There have been times where I got a 502 gateway error which maybe due to lack of memory. Sometimes, after installing a plugin, I have to refresh my admin panel several times.

Other threads say 1 GB of RAM is enough, but what is realistic? I’m using the latest docker image by bitnami. Some say that sidekiq can take up to 4 GB of RAM: discourse-sidekiq rubby take 4G of RAM · Issue #150 · bitnami/bitnami-docker-discourse · GitHub

1 Like

You can easily run Discourse off a VPS with 2GB of RAM. You may want to consider setting up swap if you don’t have that already. Running ./discourse-setup will do this for you.

3 Likes

I did initially setup swap, but if I use swap memory, it slows it down by a lot, so by default, I didn’t want to do that.

1 Like

Our default configuration should only use swap under pressure, like during web updates.

If you host a large community and start experiencing slows response times from the Discourse API you can increase the CPU/RAM of your server and re-run ./discourse-setup so it starts using the augmented resources.

5 Likes

Is this a new community or did you import a large database? How much traffic do you expect? Single thread cpu speed as well as SSD for storage are critical.

I didn’t import any database. This is a fresh forum with 0 posts. The only traffic is me at the moment. However, I do expect traffic that could be up to 1000 users visiting the site a day.

Oh. Don’t do that. Or ask them why your performance sucks.

See: Discourse official Standard Installation

3 Likes

Curious as to why you advocate against using the bitnami image? (assumably @AntiMetaman is referring to their new helm charts here.

But also, they’ve got new a new helm chart here

We, the team that develop Discourse, only test it against our own base image. Installs that don’t follow the Discourse official Standard Installation may subtle break anytime and we won’t provide support for it.

3 Likes

Just FYI, and offering a different perspective @AntiMetaman

Although Discourse can run on a VPS with minimal RAM, when you build and rebuild Discourse it will be quite slow compared to building on a machine with more RAM. I personally would not run a “truly” production Discourse app on 2GB of RAM, but that is just me.

FWIW (just my opinion only), I have installed Discourse on machines with 1GB, 2GB, 8GB, 32GB and 64 GB RAM servers, both VPM and dedicated, and honestly I like building Discourse on my 64 GB and 32GB machines. It’s so fast to build on 64GB :). Blazing fast to rebuild and runs so good, smooth like butter on hot toast. So, I prefer to run Discourse on “bigger” machines (more RAM, more disk space) with other applications than run in standalone mode on very small slices with minimal RAM.

However, that is based on my personal experience with Discourse and Docker and preferences. I like Discourse to rebuild fast and have plenty of “head room” in production and 2GB does not meet my requirements for build speed.

2 Likes

Discourse recommends 1GB as the minimum and I have ran installations this way and it gets slow quick, therefore I would go with 2GB.

This first 2GB last a long mile I currently run a community with ~3500 visits/day without Crawlers and some 20-30 posts per day I haven’t seen any issue with the 2GB of RAM and haven’t noticed any slow downs.

I’m almost sure @AntiMetaman that your issue is with the Bitnami image and not resources. Make sure you CPU is fast enough and if you’re able give it a second CPU (I only use 1vCPU and does the job).

3 Likes

The bitnami image is still using the stable 2.4.4. The only reason I went with bitnami was because it had a standard docker-compose.yml, so the installation process was easier. Some people who have tried to upgrade to 2.6.0 beta 1 using the official Discourse image failed. I’ll try the official discourse image and see how it goes.

1 Like

Good idea, third party packages such as the bitnami install get zero support here.

As you’ve already noted it’s also quite out of date.

2 Likes