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.

I run a Debian Linux server (with Apache 2 and MySQL) on a virtual private server with 256 MB memory. (I also use swapspace package.)

The system hanged.

The memory graph (provided by the hoster) showed that the used memory felt to almost zero (around 3 MB).

The CPU usage hit 100% at the same time.

I've rebooted the system and it works again.

What has happened?

share|improve this question

closed as off-topic by Christopher Perrin, mdpc, Ward, Andrew B, Dave M Aug 10 '13 at 16:03

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must demonstrate a minimal understanding of the problem being solved. Try including attempted solutions, why they didn't work, and the expected results. See How can I ask better questions on Server Fault? for further guidance." – Christopher Perrin, mdpc, Ward, Andrew B, Dave M
If this question can be reworded to fit the rules in the help center, please edit the question.

add comment

1 Answer 1

256MB is not much.

What do the logs say?

Without any kind of monitoring it will be hard to tell what happened in the past. If you expect the same thing to happen again keep running 'top' or 'vmstat 1' etc and watch the output while it happens.

share|improve this answer
    
Which logs to look into? Running top would be useless, because when the problem happens I could be unable to SSH connect to the hanged machine and so unable to see the output of top –  porton Aug 10 '13 at 10:52
    
Yeah you can only ever see what's leading up to it. Unless there a console available of course. Even on a VPS they may have a (virtual) console. Logs generally are located in /var/log/. I'd look at the last few /var/log/messages*. But probably you won't see much more than the out-of-memory (oom) handler kicking in. If there's a DB running on there you should maybe optimize the DB server for the little RAM available. –  Marki Aug 10 '13 at 10:59
    
grep -ri "out of memory" /var/log outputs nothing –  porton Aug 10 '13 at 11:13
1  
Running top is not useless. If you are running in a terminal session, the last top refresh before server crashing would give a lot of insight into what processes where using the most memory and CPU time. –  inetplumber Aug 10 '13 at 13:07
1  
Or you can log the output of top using a cron job to a log file(s). Something like top -b | head -n 20 > /var/log/top/date +\%m.\%d.\%Y_\%H-\%M-\%S will do you nicely. –  inetplumber Aug 10 '13 at 13:14
show 1 more comment

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