[solved] How to limit max arc size on TrueNAS SCALE?

Status
Not open for further replies.

thomasesrichter

Dabbler
Joined
Jan 18, 2019
Messages
15
I found an option on the misc menu, but that seems to relate to the way FreeBSD used to do it, I think ZFs on Linus is a different method, since Every reboot the system files reset I don't know where I can configure an ARC size limit. A little documentation for the BETA at least would be nice.
 

thomasesrichter

Dabbler
Joined
Jan 18, 2019
Messages
15

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
System tunables would be my assumption, but I haven't tried it myself. Anyone else experimented with this?

 

thomasesrichter

Dabbler
Joined
Jan 18, 2019
Messages
15
System tunables would be my assumption, but I haven't tried it myself. Anyone else experimented with this?


That's what I'm saying, there is no System Tunables in SCALE yet. there is only this misc option under System Settings that gives me this "Platform-Dependent" option of Sysctrl that looks like the system tunables, but being platform dependent I don't think its meant for the Debian distribution that comes on the TrueNAS SCALE ISO.

Screenshots:

scale tune.png
scale tune2.png
 

thomasesrichter

Dabbler
Joined
Jan 18, 2019
Messages
15
We're using OpenZFS 2.0 within SCALE. Documentation on the parameters are here:


I Think this is more suited for my predicament, I might try to set these manually and see if it persists on reboot, since most changes made outside the WebGUI on SCALE seems to reset on system reboot. (Which kinda behaves like a Fedora Silverblue, immutable system).
 

thomasesrichter

Dabbler
Joined
Jan 18, 2019
Messages
15
No dice, I tried
echo 3221225472 >> /sys/module/zfs/parameters/zfs_arc_max
and rebooted the system but after restart it return 0 (half the system memory)
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
A boot script could set the arc size at each boot time.
 

thomasesrichter

Dabbler
Joined
Jan 18, 2019
Messages
15
A boot script could set the arc size at each boot time.
I thought about that, but I don't really know if this property is effective at runtime or if it needs as reboot to work like sysctl. Can anyone confirm?
 

thomasesrichter

Dabbler
Joined
Jan 18, 2019
Messages
15
Can confirm, the way to limit max arc size on TrueNAS SCALE is to create a preinit command on the "Init/Shutdown Scripts" page under "Data Protection" menu with the command:

echo SIZE_IN_BYTES >> /sys/module/zfs/parameters/zfs_arc_max

where SIZE_IN_BYTES should be replaced by, would you know, the size you want in bytes, such as 2147483648 for 2GB
 

burmjohn

Cadet
Joined
Feb 26, 2021
Messages
9
Can confirm, the way to limit max arc size on TrueNAS SCALE is to create a preinit command on the "Init/Shutdown Scripts" page under "Data Protection" menu with the command:

echo SIZE_IN_BYTES >> /sys/module/zfs/parameters/zfs_arc_max

where SIZE_IN_BYTES should be replaced by, would you know, the size you want in bytes, such as 2147483648 for 2GB

Just to add to this, in case you wanted to test these changes w/o a reboot, you can issue that same command in shell for it take effect right away. But obviously don't forget to do the above for persistence across reboots.
 

dirtyfreebooter

Explorer
Joined
Oct 3, 2020
Messages
72
Can confirm, the way to limit max arc size on TrueNAS SCALE is to create a preinit command on the "Init/Shutdown Scripts" page under "Data Protection" menu with the command:

echo SIZE_IN_BYTES >> /sys/module/zfs/parameters/zfs_arc_max

where SIZE_IN_BYTES should be replaced by, would you know, the size you want in bytes, such as 2147483648 for 2GB

while this was working running this command in init/shutdown scripts, randomly after 10+ days of uptime, it seems to reset itself..

my init script (i have 256 GiB of ram)
Code:
echo 240518168576 > /sys/module/zfs/parameters/zfs_arc_max


seeing only half in use on dashboard, checking zfs parameter
Code:
# cat /sys/module/zfs/parameters/zfs_arc_max
134925107200


somehow this reset itself. IMHO, TrueNAS SCALE needs some separate section in the advanced settings specifically for ZFS, given this is a ZFS NAS.
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
Please add a suggestion via TrueNAS "report-a-bug".... we try to prioritise these activities based on user demand and upvotes.
 

appliance

Explorer
Joined
Nov 6, 2019
Messages
96
is Sysctl working at all? I have the items "Generated by autotune" and only now i realized none of them apply, nor can be found with sysctl. In that case, it's not a suggestion but an issue(?)
 

rotelly

Cadet
Joined
Apr 4, 2022
Messages
3
I have noticed that when scale starts/stops VMs it will adjust the value in
## Before Boot of VM with 8 GB of memory
root@blackhole[~]# echo 51539607552 > /sys/module/zfs/parameters/zfs_arc_max
root@blackhole[~]# cat /sys/module/zfs/parameters/zfs_arc_max
51539607552

## After VM Boot
root@blackhole[~]# cat /sys/module/zfs/parameters/zfs_arc_max
42000932864
 
Last edited:

inman.turbo

Contributor
Joined
Aug 27, 2019
Messages
149
instead of scaling back ARC when a vm started which needs some of that memory, scale will just warn you, then crash your system (out of memory)
 
Status
Not open for further replies.
Top