zfs icon indicating copy to clipboard operation
zfs copied to clipboard

Allow tunables to be specified in human readable units

Open Znuff opened this issue 2 years ago • 2 comments

Describe the feature would like to see added to OpenZFS

When changing tunables under /sys/module/zfs/parameters/, often times we end up doing a lot of math converting whatever values we have in mind to the value in bytes.

It would be much more human to be able to echo 128G > /sys/module/zfs/parameters/zfs_arc_max instead of having to calculate it to 134760890368.

I have sometimes felt the need to gradually increase/decrease some tunables by just a tiny amount, and doing the math of it gets a bit tedious.

How will this feature improve OpenZFS?

This would make it a bit more human-friendly when changing values around.

Additional context

For example, I was trying to decrease my ARC size after I've done some tests from ~170GB to ~128GB, and it took me a brief minute to figure out why ZFS would keep ignoring 131602432 as a size. Obviously, I wanted 134760890368.

Znuff avatar Aug 03 '23 23:08 Znuff

Just a workaround:

echo $(( 128 * 1024**3 )) > /sys/module/zfs/parameters/zfs_arc_max

filip-paczynski avatar Aug 04 '23 11:08 filip-paczynski

Important context for "which human readable units" https://github.com/openzfs/zfs/issues/11046

gdevenyi avatar Sep 17 '24 19:09 gdevenyi