We have a VPS server (it's using Virtuozzo). On a few occasions now, our VPS memory was fully used up and no new connections could be made to the server on SSH, SMTP, or POP. The only thing that works is connecting to the web service. Luckily, plesk is running on the VPS and we have been able to reboot it through plesk (as well as see that the RAM is 100% used).
I would like to find what process is causing this. I have a feeling it's MySQL, but don't really know. Is there some sort of logging I could implement that would help me find out what was the cause of this next time it happens?
Thanks.
In situations such as yours I have run
ps aux
from cron every minute so I could look back and find the memory hog. Put the following in your crontab:Caution: this may build a large log file over time.
After your next crash, you can look back through the file looking for processes that use a lot of memory (the "%MEM", "VSZ", and "RSS" columns would be where to look).
Have you tried anything like atop?