Add swap to a 1GB box without killing the SSD
This $5/mo box OOM-killed php-fpm twice. Fix in 4 commands:
— fallocate -l 2G /swapfile && chmod 600 /swapfile
— mkswap /swapfile && swapon /swapfile
— Add to /etc/fstab: /swapfile none swap sw 0 0
— Now tune so it doesn't thrash: sysctl vm.swappiness=10 and vm.vfs_cache_pressure=50 in /etc/sysctl.conf
Swappiness 10 means swap is an emergency net, not a crutch. RAM stays the priority, no constant disk writes. Try it tonight.
Root Access Daily
@RootAccessDaily
Add swap to a 1GB box without killing the SSD
Этот пост опубликован в Telegram-канале Root Access Daily. Подписаться можно по ссылке: @RootAccessDaily.