Feature #19496
closed
I wrote initial version of a script that gracefully terminates Passenger processes consuming more than 2.5 GB of private RSS memory. Typical consumption of Foreman with Katello and other basic plugins is around 1.5 GB and since only Passenger Enterprise allows to limit maximum amount of RSS memory for processes, this simple script does exactly that:
https://gist.github.com/lzap/8dddbe66ec8d43cbd4277c1de7045c17
Put it into your /etc/cron.hourly/ and make it executable, make sure you read root emails or forward it properly, the script reports all terminations performed on STDOUT. I would like you to test this script in production and get back to me with feedback about what you think.
Motivation is simple - we often introduce bugs in our Rails codebase which performs some eager loading or there are memory leaks in our code or dependencies and Passenger processes can grow up to dozens gigabytes. Unfortunately, there is no other way of getting out other than restarting httpd with passenger. This script could help to avoid situations when production instance starts to swap hard thank to some small regression we introduced. Also administrator will be noticed early via email when this happens so we will keep track of these regressions in production.
- Status changed from New to Ready For Testing
- Assignee set to Lukas Zapletal
- Pull request https://github.com/theforeman/foreman/pull/4540 added
- Bugzilla link set to 1452772
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
- Translation missing: en.field_release set to 296
- Translation missing: en.field_release deleted (
296)
Removing release again, foreman maintain is async to foreman releases. I suppose it deserves its own redmine project.
- Project changed from Foreman to Foreman Maintain
- Category deleted (
Rake tasks)
Yes, it deserves and it actually has :)
- Pull request https://github.com/theforeman/foreman_maintain/pull/89 added
- Pull request https://github.com/theforeman/foreman_maintain/pull/133 added
Also available in: Atom
PDF