Killed the OOM reaper on a 1GB box with zram
Just did this on a $4 Vultr box running 6 WordPress sites. PHP-FPM kept getting OOM-killed mid-traffic, ~2 crashes/day.
Added compressed RAM swap instead of disk swap:
— modprobe zram && echo lz4 > /sys/block/zram0/comp_algorithm
— echo 768M > /sys/block/zram0/disksize && mkswap /dev/zram0 && swapon -p 100 /dev/zram0
Usable RAM jumped from 1GB to effectively ~1.6GB. Zero OOM kills in 30 days, p99 response stayed under 400ms. Disk swap got demoted to priority 10 as backup.
Try it tonight.
Root Access Daily
@RootAccessDaily
Killed the OOM reaper on a 1GB box with zram
Этот пост опубликован в Telegram-канале Root Access Daily. Подписаться можно по ссылке: @RootAccessDaily.