increase readahead to improve page cache use

This commit is contained in:
Joe Lothan 2026-05-26 02:07:38 -04:00
parent 02437a677c
commit 767083fb5e

View file

@ -9,6 +9,14 @@ export HOME=/root
echo "=== EveryTab EC2 Bootstrap ==="
# --- EBS readahead ---
# Large readahead improves bundle gen throughput by prefetching icon files into page cache.
# 16MB readahead (32768 sectors × 512 bytes). Safe for all pipeline stages.
echo "--- Setting EBS readahead ---"
ROOT_DEV=$(findmnt -no SOURCE / | sed 's/p[0-9]*$//')
sudo blockdev --setra 32768 "$ROOT_DEV"
echo "Readahead: $(blockdev --getra "$ROOT_DEV") sectors on $ROOT_DEV"
# --- File descriptor limits ---
echo "--- Raising file descriptor limits ---"
echo '* soft nofile 65536' | sudo tee -a /etc/security/limits.conf