On Thu, Nov 18, 2010 at 09:18:54AM +0100, Julien Vehent wrote:
> Hi all,
> 
> I've been using SPBH and Postgresql and my setup is rather slow. It 
> seems that postgresql is eating most of the CPU time of the machine, 
> even so I don't receive more than 300 messages a day on that setup.
> 
> I check the logs of postgres and I have files filled with lines like this
> 
> ----
> 2010-11-14 07:42:25 CET STATEMENT:  PREPARE dspam_update_plan (bigint) 
> AS UPDATE dspam_token_data SET 
> last_hit=CURRENT_DATE,innocent_hits=innocent_hits+1 WHERE uid=1 AND 
> token=$1;PREPARE dspam_insert_plan (bigint,int,int) AS INSERT INTO 
> dspam_token_data (uid,token,spam_hits,innocent_hits,last_hit) VALUES 
> (1,$1,$2,$3,CURRENT_DATE);
> 
> 2010-11-14 07:42:25 CET ERROR:  duplicate key value violates unique 
> constraint "dspam_token_data_uid_key"
> ----
> 
> What is this ? Could it cause a performance problem ?
> 
> Also, I use a basic Debian setup for postgres, is there any optimization 
> I can do to the postgres conf to speed things up ?
> 
> 
> Thanks,
> 
> Julien
> 

You can get a duplicate key error if two DSPAM processes are trying
to insert the same key at the same time. Only one insert will succeed
and the second instance will retry with an update which will then
succeed. I would not recommend using SPBH since it generates a very
large number of tokens. Use OSB instead, it is more accurate that
SBPH and the number of tokens is much less.

Cheers,
Ken

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Dspam-user mailing list
Dspam-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspam-user

Reply via email to