-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[201803][monit] Restart rsyslog service if rsyslogd consumes > 800 MB memory #2963
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -268,6 +268,10 @@ check system $HOST | |
if memory usage > 50% for 5 times within 10 cycles then alert | ||
if cpu usage (user) > 90% for 5 times within 10 cycles then alert | ||
if cpu usage (system) > 90% for 5 times within 10 cycles then alert | ||
check process rsyslog with pidfile /var/run/rsyslogd.pid | ||
start program = "/bin/systemctl start rsyslog.service" | ||
stop program = "/bin/systemctl stop rsyslog.service" | ||
if totalmem > 800 MB for 5 times within 10 cycles then restart | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Do we need to keep a restart counter somewhere? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good question, what is the log message for such restart. we can search the syslog for such cases. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Each cycle that monit detects the memory has exceeded the threshold it will log the following:
And if it meets the criteria (5 of these within 10 cycles), it will log the following when it attempts to restart the service:
|
||
EOF | ||
|
||
## Config sysctl | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about the rsyslog processes inside docker? Do they matter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have not seen the rsyslogd memory leak occur on a rsyslogd process inside any Docker container. The assumption is that those rsyslogd processes have a very light load, whereas the rsyslogd process in the host image also acts as the rsyslog server for all of those processes, so it handles a much higher load of messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rsyslog within container is better managed within the container, for example use superlance with supervisord or use container option to limit the whole memory consumption for the container.