Knowledgebase

Out of Memory Errors and Process Kills Print

  • vpsservermanagement, database, php, troubleshooting, guide, howto, solution, zillionkinghost
  • 0

When the kernel starts killing things.

WHAT HAPPENS

When memory is exhausted, the kernel selects a process and terminates it to keep the system running. It usually chooses the largest, which is often the database.

WHAT YOU SEE

A service stopped with no obvious reason The site failing intermittently Messages in the system log about a process being killed

CONFIRMING IT

Search the system log for out-of-memory messages. They name the process killed and the time.

THE CAUSES

Too many PHP-FPM processes for the available memory A database buffer pool set larger than available memory An application leaking memory Genuinely insufficient memory for the workload

THE FIXES

Calculate PHP-FPM maximum children from actual per-process memory and available memory, rather than guessing Set the database buffer pool to fit alongside everything else Add swap as a safety margin, though relying on it means you need more memory Add memory if tuning does not resolve it

PREVENTING RECURRENCE

Monitor memory and alert before exhaustion rather than discovering it from a killed process.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot