From owner-freebsd-questions@FreeBSD.ORG Thu Feb 9 22:40:25 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6FAA616A420 for ; Thu, 9 Feb 2006 22:40:25 +0000 (GMT) (envelope-from mjeung@cisdata.net) Received: from dagobah.cisdata.net (dagobah.cisdata.net [63.82.223.109]) by mx1.FreeBSD.org (Postfix) with ESMTP id E460143D58 for ; Thu, 9 Feb 2006 22:40:24 +0000 (GMT) (envelope-from mjeung@cisdata.net) Received: from adsl-69-237-115-101.dsl.scrm01.pacbell.net ([69.237.115.101] helo=[192.168.45.136]) by dagobah.cisdata.net with esmtp (Exim 4.52 (FreeBSD)) id 1F7KSh-000MUQ-EX for freebsd-questions@freebsd.org; Thu, 09 Feb 2006 14:40:28 -0800 Mime-Version: 1.0 (Apple Message framework v746.2) To: freebsd-questions@freebsd.org Message-Id: <198B068F-868F-4666-9102-581C80C18A92@cisdata.net> Content-Type: multipart/signed; micalg=sha1; boundary=Apple-Mail-65-156345104; protocol="application/pkcs7-signature" From: Michael Jeung Date: Thu, 9 Feb 2006 14:40:18 -0800 X-Mailer: Apple Mail (2.746.2) X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: MySQL Connection Problems X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2006 22:40:25 -0000 --Apple-Mail-65-156345104 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Hello all, I'm running into a intermittent and very annoying problem with all of my servers. I'm currently running FreeBSD 4.11, exim-4.51-0, and mySQL 4.1.13. My exim config is setup to have exim do a mySQL lookup in order to determine whether a given user's e-mail is hosted by our e-mail servers. Periodically, Exim throws the following error into its panic log: Feb 9 13:24:51 mx_server_1 exim[69953]: 2006-02-09 13:24:51 failed to expand "${lookup mysql {select distinct domain from email_table where domain='$domain'}{$value}}" while checking a list: lookup of "select distinct domain from email_table where domain='bob.com'" gave DEFER: MYSQL connection failed: Can't connect to MySQL server on '127.0.0.1' (61) (where bob.com is one of our customer's domains that we host.) This has been happening for months, and I'm trying to get rid of these errors. The come in bursts - in a single second, I could get as many as 30 to 40 of these messages. Now, I've taken a few different steps to track this down, but the problem is very elusive and hard to replicate. The mySQL error logs are unhelpful. I'm sure that my mySQL server isn't running out of connections, because if it was, I would receive a "too many connection" error message. (I deliberately lowered the max number of mySQL connections to test this.) I'm wondering if there's a system level limit that I'm running into that would be independant of exim or mySQL's configuration. I'm a little hazy in this area, but I would be talking about some sysctl variable, a ulimit on open sockets, or something to that effect. I'm rather stumped on this issue, so if anyone has any suggestions or hints on what might be causing this error or where I might start looking to find the root cause of the problem, I would be very grateful. Thanks, Michael Jeung --Apple-Mail-65-156345104--