Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set ZFS ARC max/min before importing zpool #9711

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions charts/hedera-mirror-common/templates/zfs/configmap-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@ data:
echo "Configuring zpool ${POOL}"
partprobe

ARC_SIZE_GB="${ARC_SIZE_GB:-2}"
echo "Configuring arc max to ${ARC_SIZE_GB}GB and arc min to 1/4 of max"
ARC_MAX="$((ARC_SIZE_GB*1073741824))"
ARC_MIN="$((ARC_MAX/4))"
echo $ARC_MIN >> /sys/module/zfs/parameters/zfs_arc_min
echo $ARC_MAX >> /sys/module/zfs/parameters/zfs_arc_max

if (zfs list | grep -q "${POOL}"); then
echo "Found existing pool. Skipping creation"
elif (zpool create -o autoexpand=on "${POOL}" /dev/sdb); then
Expand Down Expand Up @@ -235,11 +242,6 @@ data:
echo "No L2 cache device specified. Skipping ..."
fi

ARC_SIZE_GB="${ARC_SIZE_GB:-2}"
echo "Configuring arc to ${ARC_SIZE_GB}GB"
ARC_SIZE="$((ARC_SIZE_GB*1073741824))"
echo $ARC_SIZE >> /sys/module/zfs/parameters/zfs_arc_max

zfs set primarycache=metadata xattr=sa "${POOL}"
zpool set autoexpand=on "${POOL}"
zpool online -e "${POOL}" /dev/sdb
Expand Down
Loading