{"action":"created","issue":{"url":"https://api.github.com/repos/turnkeylinux/tracker/issues/276","labels_url":"https://api.github.com/repos/turnkeylinux/tracker/issues/276/labels{/name}","comments_url":"https://api.github.com/repos/turnkeylinux/tracker/issues/276/comments","events_url":"https://api.github.com/repos/turnkeylinux/tracker/issues/276/events","html_url":"https://github.com/turnkeylinux/tracker/issues/276","id":49021956,"number":276,"title":"Need OOM Killer Protection","user":{"login":"OnePressTech","id":5376644,"avatar_url":"https://avatars.githubusercontent.com/u/5376644?v=3","gravatar_id":"","url":"https://api.github.com/users/OnePressTech","html_url":"https://github.com/OnePressTech","followers_url":"https://api.github.com/users/OnePressTech/followers","following_url":"https://api.github.com/users/OnePressTech/following{/other_user}","gists_url":"https://api.github.com/users/OnePressTech/gists{/gist_id}","starred_url":"https://api.github.com/users/OnePressTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OnePressTech/subscriptions","organizations_url":"https://api.github.com/users/OnePressTech/orgs","repos_url":"https://api.github.com/users/OnePressTech/repos","events_url":"https://api.github.com/users/OnePressTech/events{/privacy}","received_events_url":"https://api.github.com/users/OnePressTech/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/turnkeylinux/tracker/labels/feature","name":"feature","color":"009800"},{"url":"https://api.github.com/repos/turnkeylinux/tracker/labels/lamp","name":"lamp","color":"eb6420"},{"url":"https://api.github.com/repos/turnkeylinux/tracker/labels/lapp","name":"lapp","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/turnkeylinux/tracker/milestones/7","html_url":"https://github.com/turnkeylinux/tracker/milestones/14.1","labels_url":"https://api.github.com/repos/turnkeylinux/tracker/milestones/7/labels","id":1136255,"number":7,"title":"14.1","description":null,"creator":{"login":"JedMeister","id":818633,"avatar_url":"https://avatars.githubusercontent.com/u/818633?v=3","gravatar_id":"","url":"https://api.github.com/users/JedMeister","html_url":"https://github.com/JedMeister","followers_url":"https://api.github.com/users/JedMeister/followers","following_url":"https://api.github.com/users/JedMeister/following{/other_user}","gists_url":"https://api.github.com/users/JedMeister/gists{/gist_id}","starred_url":"https://api.github.com/users/JedMeister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JedMeister/subscriptions","organizations_url":"https://api.github.com/users/JedMeister/orgs","repos_url":"https://api.github.com/users/JedMeister/repos","events_url":"https://api.github.com/users/JedMeister/events{/privacy}","received_events_url":"https://api.github.com/users/JedMeister/received_events","type":"User","site_admin":false},"open_issues":40,"closed_issues":33,"state":"open","created_at":"2015-05-27T15:09:35Z","updated_at":"2016-01-23T01:20:19Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2014-11-17T00:27:41Z","updated_at":"2016-01-23T04:50:59Z","closed_at":null,"body":"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).\r\n\r\nWhile the apache server is configured to restart itself if it is killed, for some reason the database is not configured to restart itself.\r\n\r\nSuggestion (would be nice to have in the upcoming 13.1 / 14 release time permitting):\r\n\r\n1) 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).\r\n\r\n2) set the database to restart itself when it dies (at least 1 retry)\r\n\r\n3) 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)."},"comment":{"url":"https://api.github.com/repos/turnkeylinux/tracker/issues/comments/174140758","html_url":"https://github.com/turnkeylinux/tracker/issues/276#issuecomment-174140758","issue_url":"https://api.github.com/repos/turnkeylinux/tracker/issues/276","id":174140758,"user":{"login":"OnePressTech","id":5376644,"avatar_url":"https://avatars.githubusercontent.com/u/5376644?v=3","gravatar_id":"","url":"https://api.github.com/users/OnePressTech","html_url":"https://github.com/OnePressTech","followers_url":"https://api.github.com/users/OnePressTech/followers","following_url":"https://api.github.com/users/OnePressTech/following{/other_user}","gists_url":"https://api.github.com/users/OnePressTech/gists{/gist_id}","starred_url":"https://api.github.com/users/OnePressTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OnePressTech/subscriptions","organizations_url":"https://api.github.com/users/OnePressTech/orgs","repos_url":"https://api.github.com/users/OnePressTech/repos","events_url":"https://api.github.com/users/OnePressTech/events{/privacy}","received_events_url":"https://api.github.com/users/OnePressTech/received_events","type":"User","site_admin":false},"created_at":"2016-01-23T04:50:59Z","updated_at":"2016-01-23T04:50:59Z","body":"You're getting the hang of it now :-)\r\n\r\n- Apache processes are not killed ahead of the MySQL even though their proliferation is what is causing the problem because individual apache processes are smaller than the database process.\r\n- It is my understanding as well that the OOM killer priority will need to be refreshed via cron job as there is no place to set it as a static configuration item associated with spawned processes of a certain type...some software needs to check the running processes and IF it is a MySQL process then it is given a OOM Killer priority boost.\r\n- mysqltuner pre-install would be useful but not for the non-techie subscribers obviously...what is more useful for this particular issue is actually an apache tuner that self-adjusts the apache config file based on the RAM available and the average / max apache process size (which tends to grow over time in the case of WordPress as more plugins are added).\r\n- mysql restart without clearing up an apache process spawnathon would just thrash the VM"}}