On 11/18/10 01:18, 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" > ----
I'm not running 3.9.1 but I do get some similar errors. It appears to me that dspam first tries to INSERT and counts on the constraint to throw an error if the INSERT will duplicate an existing record. It then runs an UPDATE instead. Is the log snip above follewed by an UPDATE statement that succeeds? > 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 Postgresql is by default installed with a minimal configuration. There are tuning guides available but the handiest is called pgtune. http://pgfoundry.org/projects/pgtune/ Hope that helps! Jeff Ross ------------------------------------------------------------------------------ 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