openzfs / zfs

OpenZFS on Linux and FreeBSD
https://openzfs.github.io/openzfs-docs
Other
10.69k stars 1.75k forks source link

Allow tunables to be specified in human readable units #15152

Open Znuff opened 1 year ago

Znuff commented 1 year ago

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.

filip-paczynski commented 1 year ago

Just a workaround:

echo $(( 128 * 1024**3 )) > /sys/module/zfs/parameters/zfs_arc_max
gdevenyi commented 2 months ago

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