تبديل ذاكرة Discourse (تحذير 1 جيجابايت)

Hi,

I attempted to install Discourse on a digital ocean droplet with 1gb of RAM, the installer stated I should ideally be using 2gb of RAM, it mentionned swap files and that I could potentially run into problems with future upgrades.

Therefore is it safe to start with 1GB and if required upgrade the RAM later - would Discourse automatically use the additional RAM or would one need to amend the configuration in some way to allow for more RAM in future - and if so how?

You can run on the 1GB of ram to start with however I believe you would need a 2GB swap file to go with it in order to allow it to peak when doing resource intensive stuff such as upgrades etc.

If you have the 1GB Ram + 2GB Swap it should keep you going for a while thats for sure.

There are many posts on the forum about it so worth having a search through

If you let it, ./discourse-setup will create the swap file for you and configure the OS to try very hard never to use it.

Perhaps I should add the bolded words the message below?

في عام 2017، كان برنامج التثبيت يُنشئ مساحة تبديل (Swap) تلقائيًا عندما لا تكون ذاكرة الوصول العشوائي (RAM) كافية.

يبدو أنه حتى لو قمت بإضافة مساحة التبديل يدويًا، فلن يستمر التثبيت.

لقد اختبرت للتو التثبيت على خادم Digital Ocean جديد بسعة 1 جيجابايت باستخدام تعليمات التثبيت السحابي الافتراضية الخاصة بنا، وقد نجح الأمر دون مشاكل:

root@delete-me-install-test:~# sudo -s
root@delete-me-install-test:~# git clone https://github.com/discourse/discourse_docker.git /var/discourse

Cloning into '/var/discourse'...
remote: Enumerating objects: 41, done.
remote: Counting objects: 100% (41/41), done.
remote: Compressing objects: 100% (28/28), done.
remote: Total 4455 (delta 15), reused 23 (delta 12), pack-reused 4414
Receiving objects: 100% (4455/4455), 968.00 KiB | 10.75 MiB/s, done.
Resolving deltas: 100% (2833/2833), done.

root@delete-me-install-test:~# cd /var/discourse
root@delete-me-install-test:/var/discourse# ./discourse-setup

WARNING: Discourse requires at least 2GB of swap when running with 2GB of RAM
or less. This system does not appear to have sufficient swap space.

Without sufficient swap space, your site may not work properly, and future
upgrades of Discourse may not complete successfully.

Ctrl+C to exit or wait 5 seconds to have a 2GB swapfile created.
2097152+0 records in
2097152+0 records out
2147483648 bytes (2.1 GB, 2.0 GiB) copied, 6.28174 s, 342 MB/s
Setting up swapspace version 1, size = 2 GiB (2147479552 bytes)
no label, UUID=2233bd64-65cf-4468-9548-ab7897657855
/swapfile       swap    swap    auto      0       0
vm.swappiness = 10
Ports 80 and 443 are free for use
'samples/standalone.yml' -> 'containers/app.yml'
Found 1GB of memory and 1 physical CPU cores
setting db_shared_buffers = 128MB
setting UNICORN_WORKERS = 2
containers/app.yml memory parameters updated.

Hostname for your Discourse? [discourse.example.com]: 

لقطة شاشة تظهر أنه يعمل بنجاح على عنوان IP:

لذا، لست متأكدًا مما تتحدث عنه.

نعم، الأمر غريب جداً. لقد حاولت مرة أخرى ونجح الأمر كما أشرت.

أستخدم Amazon AWS على نظام Ubuntu 18.04. وبسبب الخطأ الذي واجهته، اضطررت إلى ترقية مثيلي (instance) للحصول على 2 جيجابايت من الذاكرة لكي أتمكن من إكمال الإعداد.

أنا في وضع مشابه. لقد أنشأت قطرة (Droplet) بسعة 2 جيجابايت مع Discourse على DigitalOcean. تظهر هذه التحذيرات عند بدء تشغيل القطرة:

WARNING: Discourse requires at least 2GB of swap when running with 2GB of RAM
or less. This system does not appear to have sufficient swap space.

لكن توثيق DigitalOcean يوصي بعدم إنشاء مساحة تبديل (SWAP) للقطرة التي تستخدم قرصًا صلبًا من نوع SSD. وقرصي يستخدم SSD (مثل جميع القطرات على ما أظن).

لذلك أنا مرتبك بشأن ما يجب فعله. ما هو توصيتك؟

إذا قمت بالتثبيت وفقًا لـ التثبيت القياسي الرسمي لـ Discourse، فسنقوم تلقائيًا بإعداد مساحة التبادل (swap) لك، ولا حاجة للتعامل معها يدويًا.