[Mimedefang] MySQL Greylisting - server has gone away

Paul Murphy pjm at ousekjarr.org
Mon Mar 20 07:19:58 EST 2006


Over the last couple of years, I've been using the MySQL version of
greylisting with an excellent level of impact on incoming spam.  However, as
I reported before, my slaves were dying occasionally:

> Paul Murphy pmurphy at ionixpharma.com 
> Fri Apr 8 06:12:19 EDT 2005 
> I've been getting problems with my filter dropping its MySQL connection
> occasionally, which means that incoming mail fails during the greylist
check -
> effectively, it is forced to try again, since the Sendmail session sends
> "reject=451 4.7.1 Please try again later" as a result of the slave dying.

I've finally found what I think is the cause of the problem - MySQL drops
idle client connections if nothing has been heard from them in 8 hours (28800
seconds).  This is controlled by the wait_timeout system variable, which can
be set to a higher value.  See
http://dev.mysql.com/doc/refman/5.0/en/gone-away.html for details.

I was recommended to try all sorts of solutions, none of which made any
difference, but this one appears to have cracked it.

Note that this only happens on very low volume servers or where you have many
more slaves than you actually need - if each of your slaves can be guaranteed
to process one connection every 8 hours, you'll never see this!  In my case,
I have a small system at home using 5 slaves and which receives about 120
connections per day, almost all of which are between 0700 and 2300, so some
of the slaves will be idle for longer than 8 hours overnight.

The relevant settings appear in my.cnf, editable directly or via the
mysql-admin GUI:

	#The number of seconds the server waits for activity on an
	#connection before closing it. Default 28800
	#The number of seconds the server waits for activity on a connection 
	#before closing it. Default 28800

Hope that helps someone else out there!


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.2.5/284 - Release Date: 17/03/2006

More information about the MIMEDefang mailing list