Server not responding to SSH and HTTP but ping works

I requested an hard reboot because none of ssh and http worked. Ping worked normally.

Which logs should i check to understand what was the problem?

Thanks! (debian 6 on lamp)

Edit: my memory and swap:

Mem:   4040068k total,  1114920k used,  2925148k free,   109212k buffers
Swap:  1051384k total,        0k used,  1051384k free,   283820k cached

4 GB ram

(and more than 1TB of HDD)

The cause is from 2 days ago:

look how the usage of swap goes +60% in less than 10hours

My control panel reports this as top 5 memory usage process:

If every apache2 process is 190MB large that sux because IF i do TOP i have 262 sleeping process most of them are apache2!

My apache mpm_prefork settings are:

<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    ServerLimit      1500
    MaxClients            1500
    MaxRequestsPerChild   2000
</IfModule>

KeepAlive On


MaxKeepAliveRequests 100


KeepAliveTimeout 4

Which logs should i check to understand what was the problem?

All of them. ping working just means enough of the IP stack is up to process ICMP Echo requests (that's not a huge portion of the system compared to what's required for SSH and web servers). You could have had what I call a "partial panic" (Kernel blew up, but the IP code kept running), run out of RAM, or your SSH/HTTPd processes could have fallen over for unspecified reasons.

/var/log/messages is probably a good starting point, as is the log for your web server (presumably Apache). If nothing else it will give you an idea of when the system last worked and how long it was in the brain-dead state before it got rebooted...


Update based on comment

Sounds like something has a memory leak.
When you ran out of swap userland blew up but the kernel (being wired in RAM) could keep running & answering ping requests.

For a permanent resolution you should monitor your swap utilization carefully and when you notice it trending dangerously upward (>33% used is my threshold) hunt down the process with the most swap used: That's probably your culprit.