Free used memory / RAM

Hi Community,

I run NS as a VM within Proxmox. From time to time I notice quite a large usage of memory, see picture for detail. I had a usage of approx. 80 % of 32 GB RAM (marked red). I was searching the internet for an option to release memory. I found this here:

https://www.linuxmaker.com/tutorials/ram-freigeben.html

Sorry, it is not available in English. So I set of those two command lines as root within NS

sync ; sync ; sync ; echo 3 > /proc/sys/vm/drop_caches
sync ; sync ; sync ; swapoff -a && swapon -a

And, wow, my memory usage dropped below 25 % (yellow marks).

Additional: I applied those two commands on another VM guest (Ubuntu) with the same result …

Question: I know, the manual reads it could be dangerous, but would it make sense to fire off such commands regularly, e.g. every night, by a cron-job? Would it be possible to incorporate something like that into NS?

TIA
Thorsten

Absolutely not. You paid for the RAM–why not use it?

4 Likes

Linux ate my ram :smiley: and It is normal

3 Likes

Hallo @danb35 @stephdl,

thanks for clarification. Yes, I understand, and you are right. Anyway this is a discussion forum. So let’s discuss :slight_smile:

In my case I use balloning VM devices within Proxmox. RAM ranges from 16 to 32 GB and if I sum up all minimum assignments, I end up approx. 16 GB below the physically installed RAM of 128 GB. On the other hand, the sum of all maximum assignments is more the 128 GB. Thus, Proxmox shares the memory based on requests. I am not sure if Proxmox asks a currently less used VM to liberate RAM in order to assign it to a more used VM. If so, no problem. I am sure there is some mechanism, otherwise load balance of VM would not work at all. On the other hand, a VM (as any other human project manager) would answer the host, that it can not liberate RAM resources - it is in use.

If not it would be interesting to make sure that each machines caches only those data which is likely to be needed within the come time interval. If each VM caches just everything this would be contra productive. Now my observation:

I run those commend short after a reboot of NS VM. The RAM usage was at 80 % and dropped to 25 %. Now, 24 h later, RAM usage is at 35 %. This lights a spark of doubt in my mind. If 80 % were really required for cache, why were those files not cached again? In other words - were the missing 50 % really necessary to cache or was it just a relict of boot sequence?

You convinced me that firing of those commands above is not meaningful, but it could be helpful from time to time. Maybe

sync ; sync ; sync ; echo 1 > /proc/sys/vm/drop_caches
sync ; sync ; sync ; swapoff -a && swapon -a

may make sense once a week or so?

Best regards
Thorsten

Wouahhhh how many clients connected at the same time :slight_smile:

My advice would be to set a dedicated ram to the VM an not the balloning.

If you care about speed, you can set the swapiness to 10, then you will start to swap only when you will have more of 90% of ram full

I do have long uptime, I speak in year, ram is not my hobby, linux plays well with it

1 Like

D

I think it is not too much, just 6-8 on just one node: Permanently online are

  • my beloved NS “one in all instance”
  • Plex Media Server
  • EcoDMS dedicated Ubuntu LTS
  • Calibre / Sage Math dedicated Ubuntu LTS
  • Clonezilla Server
  • greenborne security manager. Not allways online: EcoDMS showroom

Currently online:

  • NS playground for WAPT
  • Lubuntu for trail and error of my second external IP (will become a permanent MX server based on NS)
  • A secondary domain controller (Zentyal, NS) to play with (does it make sense to share services instead of a “one 4 all” solution

Mostly offline:

  • ecoDMS instance will replace main server
  • a Lubuntu playground
  • 1-2 windows playgrounds
  • ecoDMS demo server for customers

I already set swapiness to 10 according to tuning recommendations directly after installation of Proxmox: Now I start to understand why all my machines run to 90 %. I think it would have been better to keep 100 …

Recently I had two crashes, but Proxmox / NS is extremly stable. Yes, years is the correct dimension for me, too. Or to be clear: it was before I started playing with some modules on my productive system.

TIA
Thorsten

1 Like

@Andy_Wismer What do you think of this ??

@nio707

Hi

So far I’ve not had to set swappiness…
I handle it like Stephdl… Let Linux handle RAM…

:slight_smile:

My 2 cents
Andy