On 11/18/2010 05:32 PM, Jeff Ross wrote:
> 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?
>

Does that mean I can safely ignore it ?

>> 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

Interesting, I will give it a shot.
I increased my shared memory to 256MB, seems to be better now, but more 
tuning/testing is definitely needed (something I would probably add to 
the doc when I publish it).
So if you guys have experience tuning pg for dspam, I'm interested.



Julien

!DSPAM:4ce6140a60351354619668!



------------------------------------------------------------------------------
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