خلال الأسابيع القليلة الماضية، لاحظت أن استهلاك ذاكرة النظام يتزايد تدريجيًا كل يوم حتى يصل إلى الحد الأقصى.
في السابق، كان استهلاك الذاكرة يتراوح بين 50% و55% (على نظام سعة 3 جيجابايت). أما الآن، وبعد تحديث النظام، يبدأ الاستهلاك عند 50% ثم يرتفع ببطء على مدار الأيام التالية ليصل إلى 85%، مما يؤدي إلى بدء استخدام ذاكرة التبديل (swap).
هل توجد طريقة لمعرفة العنصر المسؤول في Discourse عن هذا الارتفاع التدريجي في استهلاك الذاكرة؟ حيث يُظهر مدير المهام أن Ruby هي العملية التي تزيد ببطء من حجم الذاكرة التي تستهلكها. ويبدو أن كل عملية Ruby تستهلك 350 ميجابايت وتستمر في النمو (تبدأ بأقل من 200 ميجابايت مباشرة بعد التحديث).
لقد قمت بالتحديث إلى v2.3.0.beta9 +392 قبل يومين، وقد ارتفع الاستهلاك بالفعل من 50% إلى 75% ولا يبدو أنه يستقر.
You could try enabling the sidekiq logs, and then look for which job is causing the problem. Some information on those logs can be found in this commit message
The memory utilization is back up to 73% and doesnt’ seem to slowing down. It’s now beginning to take up swap space.
I’m not sure how to do this, would need some guidance. I had a look at the commit and it talks about setting 2 environment variables. How do I do this? I’m not familiar with ruby/docker and don’t want mess anything up as this is live.
Is there anything else I can look at to see why the memory utilization is creeping up?
I’m also seeing a new error in the logs after the update (2 since yesterday):
Okay so I did a update and rebuild last night. The memory usage is back up to 71% and still growing. The only way to reduce it is to restart discourse at which point it drops back down to under 50% and then starts working it’s way up again. The CPU utilization is about 1% on average.
That’s a good question, which is exactly what I had earlier, how do I find out what’s taking up memory within Discourse? I can only see the task manager which shows that Ruby is taking up more memory with time (all the instances of Ruby are growing in memory consumption).