Unix & Linux Asked by Holis on November 11, 2021
For the last 2 months I’v been investigating a problem related to some unexpected "freezes" of my Ubuntu VPS.
Somehow my VPS stops working entering an uncontrolled state, which can only be resolved by restarting manually the machine.
I thought the problem was related to memory leaks, so I decided to add the following variables to sysctl to the issue:
# panic kernel on OOM
vm.panic_on_oom=1
# reboot after 10 sec on panic
kernel.panic=10
At the beginning I thought the problem was solved (since I thought that the issue was related to the panic mode), but apparently it turned out it wasn’t.
This is a chart of my VPS usage, and as you can see the cpu goes to 100% in few seconds.
My second attempt was to add Monit to my VPS, with some rules to prevent situations like this one by stopping some service after a certain usage of memory/cpu. But I didn’t solve it.
I can’t understand where the problem is, how can I reboot the system automatically when my VPS goes in an uncontrolled state?
UPDATE:
This in an example of my Monit config:
if cpu usage > 50% for 2 cycles then alert
if cpu usage > 60% for 2 cycles then restart
if memory usage > 70% for 4 cycles then alert
if memory usage > 80% for 4 cycles then restart
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP