Skip to content

Leverage Monit to restart Apache when MySQL is killed by OOMKiller (was Need OOM Killer Protection) #276

@ghost

Description

[update by @JedMeister] I have renamed this issue to reflect the discussed path to resolve the problem. Resolution of this issue would be a component of #542, although should be something of a priority in and of itself IMO.


At present when there is a heavy run on the apache server in a LAMP appliance it sucks up all the memory and the OOM killer kills processes to free memory up. The process that usually gets killed is the database (OOM Killer terminates processes by size and priority).

While the apache server is configured to restart itself if it is killed, for some reason the database is not configured to restart itself.

Suggestion (would be nice to have in the upcoming 13.1 / 14 release time permitting):

  1. configure apache settings automatically via calculation based on average apache child size and capped percentage of physical memory taking into consideration the size of the database (as database gets bigger the memory available for apache for concurrent requests is reduced).

  2. set the database to restart itself when it dies (at least 1 retry)

  3. set the OOM priority high on the database so it is the last thing to be killed under a low memory situation (i.e. could first reduce apache memory allocation, could set OOM priority settings for webmin, phpmyadmin, and webshell to be lower than the database so they are killed before the database...then a cron job could restart them as memory settles back to a steady state).

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions