You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Christoph Petersen <li...@peterschen.de> on 2008/04/22 12:31:09 UTC

Persistent DB connections

He guys,

for my setup I use a MySQL DB as the store for bayes and AWL. Every process
is opening, querying and closing his own DB connection which results in
latency and is not necessary. I tries MyDBI (the result of the Summer of
Code 2007) but then I get strange errors in my log:

warn: spamd: DBD driver has not implemented the AutoCommit attribute at
/usr/local/lib/perl/5.8.8/DBI.pm line 689, <GEN181> line 114.

warn: Use of uninitialized value in concatenation (.) or string at
usr/local/share/perl/5.8.8/Mail/SpamAssassin/BayesStore/SQL.pm line 133,
<GEN67> line 28. 

warn: bayes: database version is different than we understand (3), aborting!
at usr/local/share/perl/5.8.8/Mail/SpamAssassin/BayesStore/SQL.pm line 136,
<GEN67> line 28.

Is there another plugin which can achieve persistent db connections? Or some
clues to fix the abovementioned issues?

BR
Christoph Petersen


RE: Persistent DB connections

Posted by Christoph Petersen <li...@peterschen.de>.
> On Tue, Apr 22, 2008 at 12:52:42PM +0200, Christoph Petersen wrote:
> > Any other ideas?
> 
> Patches welcome.  ?  :)

Perl is a long time ago... Maybe another Summer of Code project would
trigger the ambition of a poor student :P Just kidding!
 
> 
> --
> Randomly Selected Tagline:
> "If you ever reach total enlightenment while drinking beer, I bet it
>  makes beer shoot out your nose."  - Deep Thought, Jack Handy

BR
Christoph


Re: Persistent DB connections

Posted by Theo Van Dinter <fe...@apache.org>.
On Tue, Apr 22, 2008 at 12:52:42PM +0200, Christoph Petersen wrote:
> Any other ideas?

Patches welcome.  ?  :)

-- 
Randomly Selected Tagline:
"If you ever reach total enlightenment while drinking beer, I bet it
 makes beer shoot out your nose."  - Deep Thought, Jack Handy

RE: Persistent DB connections

Posted by Christoph Petersen <li...@peterschen.de>.
Hi Henrik,

> On Tue, Apr 22, 2008 at 12:31:09PM +0200, Christoph Petersen wrote:
> >
> > Is there another plugin which can achieve persistent db connections?
> Or some
> > clues to fix the abovementioned issues?
> 
> http://wiki.apache.org/spamassassin/DBIPlugin

Used the predecessor of this plugin MyDBI
(https://issues.apache.org/SpamAssassin/show_bug.cgi?id=2037) which produced
the messages I mentioned. 

> If you use amavisd-new:
> 
> http://marc.info/?l=amavis-user&m=120818305608407&w=2

I don't. I'm using simscan which invokes spamc.

Any other ideas?

BR
Christoph



Re: Persistent DB connections

Posted by Michael Scheidell <sc...@secnap.net>.


> From: Henrik K <he...@hege.li>
> Reply-To: <us...@spamassassin.apache.org>
> Date: Tue, 22 Apr 2008 13:43:41 +0300
> To: <us...@spamassassin.apache.org>
> Subject: Re: Persistent DB connections
> 
> On Tue, Apr 22, 2008 at 12:31:09PM +0200, Christoph Petersen wrote:
>> 
>> Is there another plugin which can achieve persistent db connections? Or some
>> clues to fix the abovementioned issues?
> 
> http://wiki.apache.org/spamassassin/DBIPlugin
> 
> If you use amavisd-new:
> 
> http://marc.info/?l=amavis-user&m=120818305608407&w=2
> 


I THINK for amavisd-new, you need both, right? To cache SA stuff (AWL and
bayes) and amavisd-new stuff (sql, penpals, quarantine, sql based wb lists
and policies)

_________________________________________________________________________
This email has been scanned and certified safe by SpammerTrap(tm). 
For Information please see http://www.spammertrap.com
_________________________________________________________________________

Re: Persistent DB connections

Posted by Henrik K <he...@hege.li>.
On Tue, Apr 22, 2008 at 12:31:09PM +0200, Christoph Petersen wrote:
> 
> Is there another plugin which can achieve persistent db connections? Or some
> clues to fix the abovementioned issues?

http://wiki.apache.org/spamassassin/DBIPlugin

If you use amavisd-new:

http://marc.info/?l=amavis-user&m=120818305608407&w=2


RE: Persistent DB connections

Posted by Christoph Petersen <li...@peterschen.de>.
Hi Michael,
 
> Really? Thats interesting, in all my tests MySQL has always done well,
> it is very cheap to recreate MySQL connections so the DBI Persistence
> plugin has never been a big win at all for MySQL.
> 

Yeah it is performing well. But I guess here is some space to tweak. SA is
currently performing about 764.774/s average. If I'm not mistaken you can
reduce that by the factor of 1,5 if SA doesn't need to reconnect every
child.

(..)

BR
Christoph


RE: Persistent DB connections

Posted by Christoph Petersen <li...@peterschen.de>.
Hi Michael,

> > for my setup I use a MySQL DB as the store for bayes and AWL. Every
> > process
> > is opening, querying and closing his own DB connection which results
> > in
> > latency and is not necessary.
> 
> Really? Thats interesting, in all my tests MySQL has always done well,
> it is very cheap to recreate MySQL connections so the DBI Persistence
> plugin has never been a big win at all for MySQL.
> 
> 
> > I tries MyDBI (the result of the Summer of
> > Code 2007) but then I get strange errors in my log:
> >
> > warn: spamd: DBD driver has not implemented the AutoCommit attribute
> > at
> > /usr/local/lib/perl/5.8.8/DBI.pm line 689, <GEN181> line 114.
> >
> > warn: Use of uninitialized value in concatenation (.) or string at
> > usr/local/share/perl/5.8.8/Mail/SpamAssassin/BayesStore/SQL.pm line
> > 133,
> > <GEN67> line 28.
> >
> > warn: bayes: database version is different than we understand (3),
> > aborting!
> > at usr/local/share/perl/5.8.8/Mail/SpamAssassin/BayesStore/SQL.pm
> > line 136,
> > <GEN67> line 28.
> >
> > Is there another plugin which can achieve persistent db connections?
> > Or some
> > clues to fix the abovementioned issues?
> 
> You say you tried the original plugin from here:
> 
> http://wiki.apache.org/spamassassin/DBIPlugin
> 
> and got the same error?

No I tried MyDBI which is if I'm not mistaken optimized? Will try your
version later tonight.

> 
> I have to ask, are you sure it was working without the plugin
> installed?

Otherwise I wouldn't be working at that company anymore :)

> 
> Please provide the following information:
> 
> 1) The output of the following command:
> 
> spamassassin --debug=generic,diag --lint

See the attached document for the output. As the server needed to be in
production again MyDBI isn't loaded as a plugin anymore.

> 
> 2) Your local.cf contents, feel free to block out any passwords.

local.cf:
required_hits           4.4
rewrite_header          Subject ***** SPAMFILTER / ein Service der LueneCom
*****
report_safe             1
use_bayes               1
bayes_auto_learn        1
dns_available           yes
skip_rbl_checks         0
use_dcc                 0
use_pyzor               0
use_razor2              0
use_auto_whitelist      1

In a seperate sql.cf:
bayes_store_module                      Mail::SpamAssassin::BayesStore::SQL
bayes_sql_dsn
DBI:mysql:spamassassin:xxx.xxx.xxx.xxx
bayes_sql_username                      spamassassin
bayes_sql_password                      xx
bayes_sql_override_username             root

auto_whitelist_factory                  Mail::SpamAssassin::SQLBasedAddrList
user_awl_dsn                            DBI:mysql:spamassassin:
xxx.xxx.xxx.xxx
user_awl_sql_username                   spamassassin
user_awl_sql_password                   xx

user_scores_dsn                         DBI:mysql:spamassassin:
xxx.xxx.xxx.xxx
user_scores_sql_username                spamassassin
user_scores_sql_password                xx

> 
> 3) What version of DBD::mysql you are running.

Mhh, it seems as I don't have the latest version installed. That's strange.
I deployed the system last week...

Package namespace         installed    latest  in CPAN file
DBD::mysql                   3.0008     4.006
CAPTTOFU/DBD-mysql-4.006.tar.gz

BR
Christoph

Re: Persistent DB connections

Posted by Michael Parker <pa...@pobox.com>.
On Apr 22, 2008, at 5:31 AM, Christoph Petersen wrote:
> He guys,
>
> for my setup I use a MySQL DB as the store for bayes and AWL. Every  
> process
> is opening, querying and closing his own DB connection which results  
> in
> latency and is not necessary.

Really? Thats interesting, in all my tests MySQL has always done well,  
it is very cheap to recreate MySQL connections so the DBI Persistence  
plugin has never been a big win at all for MySQL.


> I tries MyDBI (the result of the Summer of
> Code 2007) but then I get strange errors in my log:
>
> warn: spamd: DBD driver has not implemented the AutoCommit attribute  
> at
> /usr/local/lib/perl/5.8.8/DBI.pm line 689, <GEN181> line 114.
>
> warn: Use of uninitialized value in concatenation (.) or string at
> usr/local/share/perl/5.8.8/Mail/SpamAssassin/BayesStore/SQL.pm line  
> 133,
> <GEN67> line 28.
>
> warn: bayes: database version is different than we understand (3),  
> aborting!
> at usr/local/share/perl/5.8.8/Mail/SpamAssassin/BayesStore/SQL.pm  
> line 136,
> <GEN67> line 28.
>
> Is there another plugin which can achieve persistent db connections?  
> Or some
> clues to fix the abovementioned issues?

You say you tried the original plugin from here:

http://wiki.apache.org/spamassassin/DBIPlugin

and got the same error?

I have to ask, are you sure it was working without the plugin installed?

Please provide the following information:

1) The output of the following command:

spamassassin --debug=generic,diag --lint

2) Your local.cf contents, feel free to block out any passwords.

3) What version of DBD::mysql you are running.

Thanks
Michael

>
>
> BR
> Christoph Petersen
>