[monit] Restart rsyslog service if rsyslogd consumes > 800 MB memory #3117
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Configure monit to monitor the resident memory consumption of rsyslogd. If memory usage is > 800 MB for 5 out of 10 checks (2-minute cycle interval, so 10 out of 20 minutes), restart the rsyslog service, because rsyslogd is most likely leaking memory. This is the same change that was committed to the 201803 branch here: #2963.
I tested an alternative solution using systemd (which in turn uses memory cgroups, which are now supported and enabled by default in Stretch). However, now that we have configured panic_on_oom = 2 (link), this will cause ALL OOM situations (even within memory cgroups) to trigger kernel panic. This defeats the purpose, as this solution is meant to prevent OOM situations, so I have decided to utilize monit for this purpose in the master branch (Stretch) as well as the 201803 (Jessie) branch.