[Exim] Exim MySQL Problems

Top Page
Delete this message
Reply to this message
Author: Florian Schicker [Nessus Office]
Date:  
To: exim-users
Subject: [Exim] Exim MySQL Problems
Hi there!

I have a strange problem with exim 4.32 and mysql 4.0.18.
Im running exim as manualrouter only to send throu and filter (spam, av,
dnsbl) for some domains.
On one domain i get some more mail traffic (ap. 10 mails/sec) once per day
for about 1hour.

Everytime this happens, exim takes one mysql connection per incoming mail
(normally i only have 1 conn)
and doesnt disconnect them after the selects (they keep in "sleep state" at
SHOW PROCESSLIST).
so, after some minutes mysql gets max_connections (250 in my case) and
blocks new connections.
i have to restart mysql and exim to "kill" the sleeping processes.

the aftereffect is fatal, exim reaches it's max_connections limit too and
fails after that:

2004-04-22 19:02:46 SMTP connection from [194.25.134.82] (TCP/IP connection
count = 98)
2004-04-22 19:02:46 SMTP connection from [194.25.134.20] (TCP/IP connection
count = 99)
2004-04-22 19:02:47 SMTP connection from [194.25.134.82] (TCP/IP connection
count = 100)
2004-04-22 19:02:47 Connection from 194.25.134.80 refused: too many
connections
2004-04-22 19:02:47 Connection from 141.35.1.23 refused: too many
connections
2004-04-22 19:02:47 Connection from 194.25.134.19 refused: too many
connections

and so on.

my exim conf: (mysql stuff)

hide mysql_servers = localhost/db/user/password

BLOCKEDDOMAINS = ${lookup mysql{SELECT blockeddomains FROM exim}}
WHITEDOMAINS = ${lookup mysql{SELECT whitedomains FROM exim}}
RELAY_TO_DOMAINS = ${lookup mysql{SELECT relaydomain FROM exim_hub where
relaydomain='$domain'}{$value}}
RELAY_FROM_HOSTS = ${lookup mysql{SELECT relay_from_hosts FROM exim}}

smart_route:
    driver = manualroute
    domains = +relay_to_domains
    transport = remote_smtp
    condition = ${lookup mysql {select relaydomain from exim_hub \
                  where relaydomain='$domain'}{$value}}
    route_list = * "${lookup mysql {select smarthost from exim_hub \
                      where relaydomain='$domain'}{$value}}"


------ snap -------


greetings,

Florian Schicker