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