How do I avoid overcommitting vMemory in FreeNAS 11.2?

AnsisMalins

Cadet
Joined
Mar 26, 2018
Messages
8
I updated from 11.1 to 11.2, and the new UI complains that I don't have enough memory to run my VMs (see screenshot). Meanwhile the old UI starts the VM without complaint. What's going on? How do I make the new UI happy? The minimum RAM for FreeNAS is 8 GB, and I have 16 total, using 2 to 4 for VMs, leaving 10 to12 to FreeNAS.
 

Attachments

  • Screenshot (32).png
    Screenshot (32).png
    185 KB · Views: 426

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288

AnsisMalins

Cadet
Joined
Mar 26, 2018
Messages
8
So, judging by the Python code: it warns me, but then adjusts the in-RAM file cache (ARC) size to make room for the VM, but to no less than 35% of total non-kernel memory. Did I get that right?

Hitting up the console, I get:

root@freenas:~ # sysctl -h hw.physmem
hw.physmem: 16,808,472,576
root@freenas:~ # sysctl -h hw.usermem
hw.usermem: 7,600,902,144
root@freenas:~ # sysctl -h vfs.zfs.arc_max
vfs.zfs.arc_max: 10,998,763,520

Which means that ARC is set to use more memory than is available even with no VMs running? Also, wow, 8 GB just for the kernel? Should I try to adjust these numbers? So far I've been running at whatever defaults FreeNAS came with, hoping that they were set by people smarter than me.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
root@freenas:~ # sysctl -h hw.physmem
hw.physmem: 16,808,472,576
root@freenas:~ # sysctl -h hw.usermem
hw.usermem: 7,600,902,144
root@freenas:~ # sysctl -h vfs.zfs.arc_max
vfs.zfs.arc_max: 10,998,763,520

Which means that ARC is set to use more memory than is available even with no VMs running?

No, the ARC is set to use less memory than is available, because you probably have about 13-14GB free after boot. The ARC max limit is being used to reserve some memory for "other things (your VM)" without causing a crisis in the system when a large chunk is suddenly allocated for your VM. If that happened, the system might pause for a few moments while it desperately evicted ARC contents to free memory. There is no guarantee that the ARC max is ever reached.
 

AnsisMalins

Cadet
Joined
Mar 26, 2018
Messages
8
Is that it? The warning is against is a possible short hiccup while the OS redistributes RAM to the VM?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
"Short" may be in the eye of the beholder. In many cases, a NAS is expected to avoid going catatonic, because certain applications and protocols have hard timeouts. iSCSI is typically configured for 5 seconds. If you've got a system with 256GB of RAM and you're going to start up 192GB worth of VM's in it, remember that the peak speed just to read RAM is only about 10-15GB/sec if you're using DDR3, and that isn't doing any computational work such as identifying what's evictable. It is much smarter to reserve free RAM than to have to do housecleaning to clear up a bunch of it suddenly.

It's easy to forget the scale of the things we ask computers to do.
 
Top