Re:Replacing a $3000/mo Heroku bill with a $55/mo server
by ValdikSS on Wednesday October 22, 2025 @09:06AM
(#45668497)
Enables Multi-Gen LRU (improved page reclaim and caching policy).
Prevents thrashing, improves loading speeds under low ram conditions.
Requires kernel 6.1+.
Has dramatic effect especially on slower HDDs.
For slower HDDs, consider 1000 instead of 300 for min_ttl_ms.
sudo tee /etc/tmpfiles.d/mglru.conf <<EOF
w- /sys/kernel/mm/lru_gen/enabled - - - - y
w- /sys/kernel/mm/lru_gen/min_ttl_ms - - - - 300
EOF
I've had good experience with linux's multi-generation LRU feature, specifically the /sys/kernel/mm/lru_gen/min_ttl_ms feature that triggers OOM-killer when the "working set of the last N ms doesn't fit in memory".