use memory zfs_arc

msanchez

Member
Jun 15, 2020
4
1
6
46
Hello,
How to calculate optimized for zfs cache, it uses too much memory and I don't have space to create MVs. I have 3 MV of 1 Gb of memory each and 32 Gb in the host and it uses 80% of the memory.
 
First of all thank you very much for answering me, that help is already read by the problem is that it says that it recommends using 50% of the memory, now I don't think that a server with 3 MVs of which none does a constant write to the disk (dns and ldap, for example) the file system requires so much memory, my question is if there is any kind of calculation for these parameters (zfs_arc_max and min) are the most optimal possible. In fact that number (50%) must have been calculated, ergo, there must be some calculation for this.
 
there must be some calculation for this.
Not really. Set in your Size what you would like. I have here 6GB
Code:
options zfs zfs_arc_max=6589934592
Change the "6" to a number what you would like.
 
which none does a constant write to the disk (dns and ldap, for example) the file system requires so much memory

The memory is mainly used as a read cache, not a write cache and it is default for every OS on the planet. ZFS is different in the sense that the memory is not reclaimable by the kernel right now, so it kinda "hangs in there".

there must be some calculation for this.

There is none, there is not one use case either. The default for ZFS on Linux (ZoL) is 50% and depending on your use case this is too much or too little, you can't get it right. Performance of your system will degrade if you lower the memory (as with every other filesystem). Try to figure out how many VMs you're going to use and calculate backwards and use whatever is left.
 
It should also be noted, that ZFS will automatically use 50% of the computer's memory. That is the max that it will use if possible and needed.
To find out if a lower limit is high enough you can set up some performance monitoring and keep an eye on the ARC hit rate. A measure how often a read operation can be satisfied from the RAM and thus there was no need to access the slower disks for the data.

You have reached the current ideal max limit on your server before you note the hit rate to go down permanently with the new lower limit.

I don't have the graphs at hand but from my experience in the small PVE infrastructure that I run myself, I do get an ARC hit rate in the 98 to 100% range most of the time, and ZFS is not using 50% of the available memory. Of course during upgrades and when accessing stuff in the VMs that is rarely used, the hit rate will go won.
 

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!