ZFS vfs.zfs.arc_max size recommendations

I have a system (my home one) with 32 GB Memory (Intel i7-2700K) and a mirrored 2TB ZFS-Pool.

Because I have to use an image editing tool under windows, I planned to create a VM with bhyve with 16 GB Memory and 4 "CPU's" (with Hyperthreading, my processor has 4 Cores and 8 Threads). There's also Gnome3 installed on the FBSD System for the day2day work.

My question now, should I limit the vfs.zfs.arc_max to 8GB?

Thanks in advance.
 
Thanks for the link, but - as I'm correct - nothing that helped me in my question, does it? (or I have overlooked something...)
As I know, the ARC is using all memory it could get (on the production FreeNAS system in my company it uses 25 GB of 32GB) and therefore I thought to limit it, to have enough memory for the VM and my work with the system. Am I wrong?
Thanks again!
 
I have just checked, my vfs.zfs.arc_max is almost as big as vm.kmem_size, which is probably too much but I don't expect to run into the limit soon.
Your VM will take as much memory as it needs, it won't probably consume the whole 16GB unless you stress it to the max. I have a VM with 24GB of virtual memory but the physical consumption is only 200 MB when idle.
I don't know how heavy Gnome 3 is but I am running Plasma and my current total consumption is ~ 4GB of memory. Gnome should be similar (just use vmstat or htop to check).
My gut feeling says that if you should limit the arc_max, it should be about 12 GB if you plan to stress out the VM to the max or even a little bit higher if your VM is not going to be using all its memory all the time.

I am not sure about this, but if your ARC is set too high this would mean that the system memory might get used up and other apps might be unable to allocate memory. Not sure how graceful it would be, but it will probably let you the opportunity to adjust the ARC lower and restart. This needs to be checked though.
 
I am not sure about this, but if your ARC is set too high this would mean that the system memory might get used up and other apps might be unable to allocate memory.

Thanks, yes, that what I thought about. I'll try it with 12 GB (on our production system arc_max is around 32...something and kmem_size is around 33...something - without setting them in loader.conf - but that system is only for "file serving").
Thanks a lot!
 
There is no absolute "recommendation" when it comes to tweaking ARC memory usage. You're going to have to experiment with the settings until you get a point that works for you.
 
For me the OS defaults have worked reasonably well so far and I don't change them in general unless necessary.
It's probably a good idea to do some profiling and see if a change is needed.
 
For me the OS defaults have worked reasonably well so far and I don't change them in general unless necessary.
That's a good starting point. FreeBSD usually does a good job tuning itself. Don't tune for the sake of tuning. Tune because you're actually running into some limitation or bottleneck. Remember that a badly tuned OS runs worse than one that hasn't been tuned at all.
 
No, I don't want to tune for the sake of tuning! :) I only thought about it, if it would be necessary/a good idea to have enough power for my VM.
But I will have a look at the system-resources while I work in the VM and you are right, it's easy to make some adjustments to the system then.

Nice to have some good advise! :) Thank you!
 
I only thought about it, if it would be necessary/a good idea to have enough power for my VM.
ARC usually adjusts itself. But you can run into a situation where two or more applications (including ARC) are trying to compete for the same slice of the pie. In that case you can try lowing the ARC "ceiling" by setting vfs.zfs.arc_max. I wouldn't adjust any of the other ZFS/ARC parameters unless you have a good reason to do so.
 
Back
Top