كم مقدار RAM المطلوب لـ 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: https://github.com/bitnami/bitnami-docker-discourse/issues/150

إعجاب واحد (1)

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 إعجابات

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)

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.

6 إعجابات

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.

إعجاب واحد (1)

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

4 إعجابات

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 Install Discourse in production with the official, supported instructions may subtle break anytime and we won’t provide support for it.

4 إعجابات

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.

4 إعجابات

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).

4 إعجابات

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)

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)

مرحبًا @Falco - هل تقصد تشغيل هذا الأمر في وحدة التحكم أم أن تشغيل معالج الإعداد كافٍ www.mysite.com/wizard؟

إعجاب واحد (1)

إنهما في الواقع شيئان مختلفان. :slight_smile:
/wizard مخصص لإعدادات واجهة المستخدم والإدارة لإعداد موقعك بعد التثبيت، ويتم الوصول إليه عبر موقعك/متصفحك.
discourse-setup هو جزء من عملية التثبيت نفسها والتي (جزئيًا) تخصص موارد الخادم، ويتم تشغيله من الخادم.
يمكنك إعادة تشغيل discourse-setup عدة مرات ولن يقوم بالكتابة فوق أي من بيانات موقعك.

3 إعجابات

شكرا للتوضيح @JammyDodger، أقدر ذلك كثيراً.

كان موقعي يعاني من بطء شديد، لذا قمت بإضافة المزيد من ذاكرة الوصول العشوائي (RAM) إلى الخادم، ويبدو أنه يعمل بشكل أفضل الآن مع تخصيص 2048 ميجابايت من المخازن المؤقتة المشتركة بدلاً من 128 ميجابايت.

كنت أقوم بتحرير ملف app.yml يدوياً في السابق وتحميله باستخدام SFTP، وقد لاحظت للتو تحذيراً بشأن الأذونات عند إعادة بناء التطبيق الآن، فما الذي يجب ضبط ملف app.yml عليه؟

644 أو 600. أعتقد أن الرسالة التي تشير إليها تخبرك بما يجب أن تكون عليه.

إعجاب واحد (1)

شكرا @pfaffman!

إعجاب واحد (1)