Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
This doesn't smell like a memory leak to me (though I could be wrong) - Does Virtuozzo have a "system console" access? If so, can you get in to the system through that & try to troubleshoot from there? –  voretaq7 Feb 9 '10 at 3:58

2 Answers 2

up vote 1 down vote accepted

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:

* * * * * (date ; ps aux) >> $HOME/ps-aux

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).

share|improve this answer
    
Thanks. I was hoping to avoid something like that. I guess there might not be another option. –  mhost Feb 9 '10 at 23:50

Have you tried anything like atop?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.