observability.svc.plus/roles/node/files/disk_prefetch.sh
2026-02-01 20:53:55 +08:00

12 lines
262 B
Bash
Executable File

#!/usr/bin/env bash
# setup disk prefetch
if (! grep -q 'disk prefetch' /etc/rc.local); then
cat >>/etc/rc.local <<-EOF
# disk prefetch
blockdev --setra 16384 $(echo $(blkid | awk -F':' '$1!~"block"{print $1}'))
EOF
chmod +x /etc/rc.d/rc.local
fi
exit 0