Results 1 to 2 of 2
Basically, I'm running something on my server that is buggy and has a memory leak. Over time - a few hours it eventually becomes completely unresponsive on all ports/protocols and ...
- 06-24-2009 #1Just Joined!
- Join Date
- Jun 2009
- Posts
- 1
Automatic reboot (CentOS)
Basically, I'm running something on my server that is buggy and has a memory leak. Over time - a few hours it eventually becomes completely unresponsive on all ports/protocols and I have to request a hard reboot from the datacentre as I cannot logint to SSH to reboot it myself.
I am looking for a way for the server to automatically reboot itself when it is getting close to this limit. Any help will be appreciated.
- 06-25-2009 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
This is not a good solution - rebooting the system when you run out of memory due to a malfunctioning application. Fix the application instead! At the very least, monitor the memory used by the application, and restart it when it uses too much! In fact, you can set the heap limit (ulimit -d maxmem), and it will segfault when it exceeds that amount. This would be fairly easy to do in a script that starts the process, and when it dies, starts it again.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote