Ian Pushee wrote:
I am running mysql version 3.23.49 on a Debian Linux box.

Recently (about a month ago) I noticed that alot of my databse access scripts were failing intermitently. It was anoying, but I have only now gotten the time to look into the problem. It turns out that my mysql server processes are dying at irregular intervals (varying from 1 to 20 minutes or so). If a script gets executed while they are being restarted, it fails.

Debian uses safe_mysql to start/restart the server processes. If I run this as normal from init.d, the only thing that shows up in the logs is that the server is getting restarted (in mysql.err):
040308 14:21:14 mysqld restarted
/usr/sbin/mysqld: ready for connections


Number of processes running now: 0

In the normal log, there is no single query that seems to cause the server to die: in fact, it often seems to die w/out any queries being posted at all.


If I run safe_mysqld from the console, I see this whenever the server restarts:
/usr/bin/safe_mysqld: line 275: 25633 Killed $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file --skip-locking >>$err_log 2>&1


Number of processes running now: 0
040308 14:04:44  mysqld restarted


If I run mysqld straight from the console I get this (after a little whiel of the server running):
# mysqld
mysqld: ready for connections
Killed


I've checked/repaired all fo the tables in the database and found no major errors.
Anybody have any ideas what might be causing the server to restart like this?

Check your syslog for OOM kills. When Linux kernel starts running out of RAM, it will kill processes using a hueristics to pick the one that will give it the most "bang for the buck". A fat mysqld configured with a large key buffer and using lots of RAM is a prime candidate.


All 2.4 versions I've tried ( have not tried this on 2.6), have a bug that under some circusmstances would rather kill a fat process than free up buffer cache. One way to avoid this is to have lots of physical RAM + a decent swap.

http://www.mysql.com/doc/en/System.html recommends disabling swap if you have plenty of RAM. This is a bad idea on Linux, although it does make a lot of sense in theory. I have written a few messages to the kernel list in the past arguing that it would be nice to have the kernel work well without swap, but the gist of the replies I got was that no swap is basically a misconfiguration even if you have more RAM than disk space.


-- Sasha Pachev Create online surveys at http://www.surveyz.com/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to