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.
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.
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.
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.
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.
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).
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.
Thanks for the clarification @JammyDodger much appreciated.
My site had been getting quite laggy so i have added more ram to the server, seems to be running much better now with an allocation of 2048MB shared buffers up from 128MB.
I had been editing the app.yml file manually previously and uploading using SFTP and I just noticed a permissions warning when I was rebuilding the app just now, what should the app.yml file be set to?