SOLVED Increasing vfs.zfs.arc_max to Accommodate a single Linux VM

Joined
Mar 5, 2022
Messages
224
If my TrueNAS boots without starting my (single) VM because I forgot to enable auto-start, I get the following message at the top of my VM list:
Available Memory: 0.10 bytes - Caution: Allocating too much memory can slow the system or prevent VMs from running.
When I try to start the VM, I get the following message:

ERROR: Not Enough Memory​

Yes I understand the risks
help_outline
The VM could not start because the current configuration could potentially require more RAM than is available on the system. Would you like to overcommit memory?
I have 32 GB RAM and have allocated 4GB to the VM, so I want to limit the rest to 28GB.

Should I:
  1. Set the vfs.zfs.arc_max to 28 GB?
    1. Reboot afterwards?
  2. Set the VM to auto-start and reboot?
  3. Ignore the warning and just start the VM?
  4. Change the amount of memory allocated to the VM?
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Set the vfs.zfs.arc_max to 28 GB?
  1. Reboot afterwards?
No and no.

If anything, you need to take the ARC max down to less than half (which is already the default) of your RAM.

The setting (via tunable) can be set and will take effect after a reboot, but you can set it via CLI to take effect immediately.

The general wisdom on this is don't mess with it at all. (if you have it set already, remove that setting)

Set the VM to auto-start and reboot?
Only if you want it to auto-boot. You shouldn't be forced into doing that.

Ignore the warning and just start the VM?
Certainly an option, since overcommit should put pressure on memory and ARC should release it under that pressure when needed.

Change the amount of memory allocated to the VM?
Should always be as low as possible to avoid using resources that you can use for cache or elsewhere, but if 4GB is what you need... you need it.
 
Joined
Mar 5, 2022
Messages
224
No and no.

If anything, you need to take the ARC max down to less than half (which is already the default) of your RAM.

The setting (via tunable) can be set and will take effect after a reboot, but you can set it via CLI to take effect immediately.

The general wisdom on this is don't mess with it at all. (if you have it set already, remove that setting)
I have read this as well, but don't know what to do...
Only if you want it to auto-boot. You shouldn't be forced into doing that.
Normally I would leave it in auto-boot, but I am going through a bunch of initial backups and re-silvering so I have been trying to reduce stress on the memory
Certainly an option, since overcommit should put pressure on memory and ARC should release it under that pressure when needed.
From the messages, it seems like I am trying to break something :-/
Should always be as low as possible to avoid using resources that you can use for cache or elsewhere, but if 4GB is what you need... you need it.
I figured 4GB is pretty low for a GUI-based Ubuntu VM (suggestions?)


Seems like your suggestion is to just ignore the warnings and start the VM?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I figured 4GB is pretty low for a GUI-based Ubuntu VM (suggestions?)
2GB is minimal... some distros can do a gui for 1Gb or even less. Depends what you run in that GUI.

From the messages, it seems like I am trying to break something :-/
if you overcommit 5 VMs at 8GB each, yes that would certainly be right, but 1 VM at 4GB is not unreasonable.

I have read this as well, but don't know what to do...
if it's not currently set, you should try setting it to half your RAM size minus 4GB and see if that helps. (remembering that it's set in bytes only, so you need to run it through a calculator).

Or just don't worry about it and let the system handle things with the overcommit (worst case: kernel panic followed by a reboot).
 

Morris

Contributor
Joined
Nov 21, 2020
Messages
120
I've seen this warning and it probably is incorrect. If you want to be safe, restart and then start your VM. I have started the VM and then got warnings a few days later. After a restart never another warning. Make your choice based on what else is running in your environment.
 
Joined
Mar 5, 2022
Messages
224
I checked the "Enable Autotune" checkbox under System -> Advanced

I haven't seen this warning again since
 
Top