I'm using a VPS on Ubuntu 10.10 to serve my private website and Apache 2.2.16 keeps crashing without a trace. The server is on a very light load with about 300 visits/day.
To solve this I have set up monit to regularly check on apache the but that keeps crashing too.
I have checked my resource consumption and I'm well below the critical level:
I have checked /etc/apache2/errors.log and /var/log/syslog but couldn't find a trace of an error. I'm pretty much at the end of my wit.
How can I debug this issue? I'm using a pretty cheap VPS. Could they be the reason for the flakyness?
You're using a Virtuozzo instance, which isn't really a VPS but a container, basically a kernel enforced chroot. From what I've seen from my dealing with it, its OOM manager is very dodgy. Because of the way it works, another container on the same hardware node could be hogging memory, but because your processes started after the processes causing the issue, your processes get killed.
Unfortunately you can only see what the OOM is upto on the host server, so you'll have to check this with your provider. Most likely they've oversold the memory on the server you're on a bit more than they should.
To quote the Linux Memory Manager page:
My theory is that Virtuozzo hasn't touched the OOM manager in the host kernel to make it aware that there's virtualised processes running, so it doesn't realise it's killing privileged processes in your "VPS". However, that's just conjecture as I haven't been able to check it with Parallels, who're the people responsible for Virtuozzo.