5

I am running a Debian virtual server with Apache, PHP, MySQL. There is just 1 website with very low traffic running but the server very often (almost everyday) freezes and does not respond.

When this happens the server is unreachable from web browser or by SSH and I have to go to administration of my provider and perform server hard reset after this the server seems to work fine.

How can I find out what is causing the freezes?

Linux vm2797 2.6.32-5-amd64 #1 SMP Tue Jun 14 09:42:28 UTC 2011 x86_64 GNU/Linux

Petr Peller
  • 193
  • 1
  • 7
  • If it isn't already installed, I would install something like atsar. Which is a tool that will periodically collect various statistics. This may give you a useful hint. For example if your RAM usage maxes out you probably have something with a memory leak. – Zoredache Sep 26 '12 at 17:34

4 Answers4

4

Reconfigure your syslog to go to a different server -- this pushes events, any monitoring polls the server (probably miss the big segfault unless you poll at the exact instant it happens).

Grabbing logs to the machine that's crashing is a bad idea -- you will always lose the most import (read last) lines of the logs.

man rsyslog.conf gives info on redirecting to another machine, and how to configure to listen for logging messages.

The logs will show up in the syslog of the host prefaced with the name of the server they came from.

On the listening side 'man rsyslogd' will give you startup options which can then be set in /etc/default/rsyslog (you may need -4 or -6). You can verify it's listening with lsof -p pid_of_rsyslogd

Ed King
  • 941
  • 5
  • 9
3

If you don't see anything in your /var/log/syslog or /var/log/messages files, I recomend you to use any system status record tool. I use nmon (in capture data mode) to monitoring my systems.

You can find it here

Mitchbcn
  • 31
  • 1
1

The thing to do here is to look in your logs. They're usually found in /var/log. Make a note of the time you restart your system and look in the logs for messages immediately before that time.

/var/log/syslog
/var/log/messages
/var/log/apache2/error.log
/var/log/mysql*

would be good places to start.

user9517
  • 115,471
  • 20
  • 215
  • 297
1
  • Use a kdump-kernel.
  • Have your VM-Admin snapshot your VM including memory for forensic analysis.
  • Enable SysRQ and have your VM/Console-Admin issue the sync-command so logs get written to disk
Nils
  • 7,695
  • 3
  • 34
  • 73