earlyoom on CloudSonic

Protect your web server and database from memory pressure before the system ever runs out of RAM

TL;DR earlyoom

earlyoom runs on every CloudSonic server, killing low priority processes before the server runs out of memory so nginx, PHP, and your database never go down.

earlyoom is a lightweight out-of-memory process killer that runs on every CloudSonic server as a safety net for memory management. When available RAM drops below five percent, earlyoom begins terminating the least important processes before the Linux kernel's own out-of-memory killer takes over, which is slower to respond and less selective. On CloudSonic, earlyoom is configured to never kill Nginx, PHP, Redis, MariaDB, or PostgreSQL, so your web server and database always survive memory pressure events.

earlyoom for Memory Protection on CloudSonic

earlyoom runs as a background service on every CloudSonic server, continuously monitoring available RAM and acting the moment free memory drops below five percent. CloudSonic configures earlyoom with an explicit protection list that prevents it from killing Nginx, PHP, Redis, MariaDB, and PostgreSQL, so your web server and database always survive memory pressure events even if something else on the server consumes unexpected amounts of memory. earlyoom acts significantly faster than the Linux kernel's own out-of-memory killer, preventing the server from becoming unresponsive before intervention occurs.

Useful Commands

sudo systemctl status earlyoom
sudo journalctl -u earlyoom -n 50