zfs_arc_max 0

alkizx

New Member
Apr 30, 2024
4
0
1
Hello, I have a question with zfs, in version 8.2.2 when I execute the command cat /sys/module/zfs/parameters/zfs_arc_max it shows me "0"
and the command ls /etc/modprobe.d/ does not show the zfs.conf file

which might seem like the system is not using ARC, however, proxmox shows me a memory consumption of 187GB, with only 58GB of memory consumed by the virtual machines.

Storage is zpool raid10 with 4 2TB nvme drives.

The host has 256GB of RAM, I'm afraid that if I add several virtual machines, Proxmox will shut them down due to lack of memory.

How can I know exactly if ARC is being used and how much?
 
cat /proc/spl/kstat/zfs/arcstats
The field size shows the current arc size

arc_summary and arcstat also show human readable stats

I'm afraid that if I add several virtual machines, Proxmox will shut them down due to lack of memory.
ARC is freed automatically when necessary, it behaves like regular cache
 
Last edited:
when I execute the command cat /sys/module/zfs/parameters/zfs_arc_max it shows me "0"
and the command ls /etc/modprobe.d/ does not show the zfs.conf file
/etc/modprobe.d/zfs.conf is only written during the installation starting with 8.1, i.e. older installations do not get that file automagically.

That means the default is simply in place - ZFS uses 50% of RAM by default, that is why we generally recommend limiting it in our documentation.
Please see the appropriate section in our admin guide for more information: Limiting ZFS Memory Usage.

There are also lots of other threads already about this exact topic.
 
There are still more than 60GB free RAM left for VMs. I wouldn't limit the ARC till you need more than those 60GB.
Not used RAM is wasted RAM...
 
Last edited:
Indeed the size field confirms to me that it is consuming half of the memory.

Is it certain that if the memory is filled with virtual machines, the ARC memory consumption will automatically decrease without turning off the virtual machines?

If I change the value in /etc/modprobe.d/zfs, or /sys/module/zfs/parameters/zfs_arc_max for a noroot fileserver, is it necessary to reboot the host?
 
Last edited:
Is it certain that if the memory is filled with virtual machines, the ARC memory consumption will automatically decrease without turning off the virtual machines?
Yes, but this (obviously!) can still result in memory pressure in such situations, which can cause performance degradation. That's why limiting the ZFS ARC is recommended to a suitable size (see our admin guide for that) depending on the storage size, since virtualization normally needs lots of RAM itself already.

If I change the value in /etc/modprobe.d/zfs, or /sys/module/zfs/parameters/zfs_arc_max for a noroot fileserver, is it necessary to reboot the host?
I'd suggest reading a bit into the link to our admin guide I posted, where all that is explained in detail :)
You can change the ARC usage limit for the current boot (a reboot resets this change again) by writing to the zfs_arc_max module parameter directly:
Code:
echo "$[10 * 1024*1024*1024]" >/sys/module/zfs/parameters/zfs_arc_max
To permanently change the ARC limits, add (or change if already present) thefollowing line to /etc/modprobe.d/zfs.conf:
Code:
options zfs zfs_arc_max=8589934592
 
Yes, but this (obviously!) can still result in memory pressure in such situations, which can cause performance degradation. That's why limiting the ZFS ARC is recommended to a suitable size (see our admin guide for that) depending on the storage size, since virtualization normally needs lots of RAM itself already.


I'd suggest reading a bit into the link to our admin guide I posted, where all that is explained in detail :)
Thank you, I had read it, but I don't speak English as much as I would like, and there are things that I overlook.
 

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!