MySQL Bayes and timeout in amavisd
Tom Hendrikx via amavis-users
amavis-users at amavis.org
Fri Sep 27 12:01:49 CEST 2013
On 09/27/2013 10:50 AM, Stefan Jakobs via amavis-users wrote:
> Hello list,
> I like to re-ask my question from march this year, as it is still an issue:
> I run a setup with postfix 2.5.13 and amavisd-new 2.7.2 in pre-queue
> configuration. Spamassassin (3.3.2) uses a MySQL DB as bayes storage backend.
> When the MySQL DB is under high load amavisd takes too long to process a
> message which causes postfix to reject messages and report "queue file write
> errors". Below is the log of such a message as an example.
> I'm wondering why amavisd takes more than 2 hours to process that message and
> doesn't quit after 120 seconds despite $child_timeout = 120?
> Is it possible to configure amavisd/spamassassin in such a way that it will
> quit if it can not receive an result from the bayes DB in less than X seconds?
> $child_timeout = 120;
> smtpd_proxy_timeout = 125
> use_bayes 1
> bayes_store_module Mail::SpamAssassin::BayesStore::MySQL
> bayes_sql_dsn DBI:mysql:spamassassin:db.example.com;mysql_client_found_rows=0
> Mar 25 11:51:43 server postfix/smtpd: setting up TLS connection from
> Mar 25 11:51:43 server postfix/smtpd: Anonymous TLS connection
> established from host.example.com[AA.BB.CC.DD]: TLSv1 with cipher DHE-RSA-
> AES256-SHA (256/256 bits)
> Mar 25 11:51:43 server postfix/smtpd: NOQUEUE:
> Mar 25 11:51:43 server amavis: (03513-10) ESMTP:[::1]:10024
> <user at example.com> -> <myuser at mydomain.tld> SIZE=11623 Received: from
> server.mydomain.tld ([IPv6:::1]) by localhost (server.rus.uni-stuttgart.de
> [IPv6:::1]) (amavisd-new, port 10024) with ESMTP for <myuser at mydomain.tld>;
> Mon, 25 Mar 2013 11:51:43 +0100 (CET)
> Mar 25 11:51:43 server amavis: (03513-10) Checking: NWnem1z1wdjP
> [AA.BB.CC.DD] <user at example.com> -> <myuser at mydomain.tld>
> Mar 25 11:53:48 server postfix/smtpd: warning: timeout talking to proxy
> Mar 25 12:01:10 server postfix/smtpd: timeout after END-OF-MESSAGE from
> Mar 25 12:01:10 server postfix/smtpd: disconnect from
At this point, the remote host (host.example.com) has given up on you
and has disconnected because your server took too much time to return an
answer. A sane remote server would handle a timeout during transit as a
temporary error, and retry to send the same message again.
While this does not solve the amavis problem, your message is never
rejected by anyone. If the message isn't retried by host.example.com,
you discovered a bug in the remote mta.
The log also fails to show the queue write errors from postfix that you
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 901 bytes
Desc: OpenPGP digital signature
More information about the amavis-users