[SOLVED] Question about ram usage

Lucas Rey

Well-Known Member
May 18, 2018
35
21
48
51
Hello community,
I'm just checked the ram usage from GUI and OS, and I can see something not clear to me.

GUI shown a critical ram usage value:
Image 002.png

While the OS shown different ram usage (htop):
Image 003.png

So, is it a situation where I have to worry about? Which source should I believe?

Thank you
Lucas
 
Last edited:
Whats your output of free -hg? Top and similar programs often will show "available" RAM comparable to "free" RAM even if it is actually used.
 
  • Like
Reactions: Lucas Rey
Ah yes, you're right. I remembered now that htop is not a trusted source!!
So, it's time to think about RAM upgrade :)

Code:
# free -hg
               total        used        free      shared  buff/cache   available
Mem:           125Gi       119Gi       5.5Gi        69Mi       425Mi       4.8Gi
Swap:             0B          0B          0B

Thank you
Lucas
 
RAM at 90+% doesn't mean you have to be out of RAM. For example in case you re using ZFS then by default up to 50% of your RAM will be used by ZFS as its ARC for caching. ARC won't be listed as "buff/cache" but as normal "used" but ZFS can shrink it dynamically but slowly from for example 64GB down to 1GB if needed by processes.
 
  • Like
Reactions: Lucas Rey
RAM at 90+% doesn't mean you have to be out of RAM. For example in case you re using ZFS then by default up to 50% of your RAM will be used by ZFS as its ARC for caching. ARC won't be listed as "buff/cache" but as normal "used" but ZFS can shrink it dynamically but slowly from for example 64GB down to 1GB if needed by processes.
Aaaahh, you're right!! ZFS is used in local disk, where proxmox is installed (SSD mirror), and in several VMs like TrueNAS and PFSense.

Code:
        NAME                                       STATE     READ WRITE CKSUM
        rpool                                      ONLINE       0     0     0
          mirror-0                                 ONLINE       0     0     0
            ata-CT480BX500SSD1_2030E4089A27-part3  ONLINE       0     0     0
            ata-CT480BX500SSD1_2006E3E9834D-part3  ONLINE       0     0     0

But how can I determine is the used ram is allocated to ZFS or VMs? Or better, is there a way, via cli, to check how many ram are using the VMs?

Is this the ram used by ZFS?
Code:
ARC size (current):                                    73.5 %   46.0 GiB
        Target size (adaptive):                        73.5 %   46.0 GiB
        Min size (hard limit):                          6.2 %    3.9 GiB
        Max size (high water):                           16:1   62.6 GiB
        Most Frequently Used (MFU) cache size:         64.6 %   29.5 GiB
        Most Recently Used (MRU) cache size:           35.4 %   16.2 GiB
        Metadata cache size (hard limit):              75.0 %   47.0 GiB
        Metadata cache size (current):                  1.0 %  485.2 MiB
        Dnode cache size (hard limit):                 10.0 %    4.7 GiB
        Dnode cache size (current):                     0.7 %   34.0 MiB


Thank you
Lucas
 
Last edited:
Aaaahh, you're right!! ZFS is used in local disk, where proxmox is installed (SSD mirror), and in several VMs like TrueNAS and PFSense.

Code:
        NAME                                       STATE     READ WRITE CKSUM
        rpool                                      ONLINE       0     0     0
          mirror-0                                 ONLINE       0     0     0
            ata-CT480BX500SSD1_2030E4089A27-part3  ONLINE       0     0     0
            ata-CT480BX500SSD1_2006E3E9834D-part3  ONLINE       0     0     0

But how can I determine is the used ram is allocated to ZFS or VMs? Or better, is there a way, via cli, to check how many ram are using the VMs?

Is this the ram used by ZFS?
Code:
ARC size (current):                                    73.5 %   46.0 GiB
        Target size (adaptive):                        73.5 %   46.0 GiB
        Min size (hard limit):                          6.2 %    3.9 GiB
        Max size (high water):                           16:1   62.6 GiB
        Most Frequently Used (MFU) cache size:         64.6 %   29.5 GiB
        Most Recently Used (MRU) cache size:           35.4 %   16.2 GiB
        Metadata cache size (hard limit):              75.0 %   47.0 GiB
        Metadata cache size (current):                  1.0 %  485.2 MiB
        Dnode cache size (hard limit):                 10.0 %    4.7 GiB
        Dnode cache size (current):                     0.7 %   34.0 MiB


Thank you
Lucas
Jup, arc_summary is best for that. So right now ZFS is using 46 GiB for caching and that can change between 4GB and 64GB. So there is plenty of RAM left if you just use ZFS on your host for the two boot disks.
Rule of thumb for recommended ARC size is 2/4GB + 0.25-1 GB per 1 TB of raw storage when not using deduplication...it varies depending on who you ask.

You can also limit the ARC size as shown there: https://pve.proxmox.com/wiki/ZFS_on_Linux#sysadmin_zfs_limit_memory_usage
 
  • Like
Reactions: Lucas Rey
It will be freed up automatically when needed, but it can't be freed up as fast as the normal linux cache. Most of the time it should be fine but sometimes when alot of memory is needed very fast it can happen that you still run out of space. If such a thing is happening (monitor syslog for OOM messages) it might be useful to manually limit the ARC size.
 
  • Like
Reactions: Lucas Rey
Thank you very much, I limited the ARC size to 10 GiB and this is the result
Image 002.png

Good!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!