From 767083fb5ecc7c924cea195344d097a3300ac867 Mon Sep 17 00:00:00 2001 From: Joe Lothan Date: Tue, 26 May 2026 02:07:38 -0400 Subject: [PATCH] increase readahead to improve page cache use --- infra/ec2-userdata.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/infra/ec2-userdata.sh b/infra/ec2-userdata.sh index 594ccfa..380a3cf 100755 --- a/infra/ec2-userdata.sh +++ b/infra/ec2-userdata.sh @@ -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