Re: Performance nightmare with dspam (urgent)

From: Russell Smith <mr-russ(at)pws(dot)com(dot)au>
To: Casey Allen Shobe <cshobe(at)seattleserver(dot)com>
Cc: Postgresql Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Performance nightmare with dspam (urgent)
Date: 2005-06-07 09:43:16
Message-ID: 200506071943.16238.mr-russ@pws.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, 2 Jun 2005 06:19 am, Casey Allen Shobe wrote:
> I found this response to my original post, and tried every single suggestion
> in it, which has not helped:
>
> http://archives.postgresql.org/pgsql-performance/2004-11/msg00416.php
>
> I'm sorry to come begging for help, but this is a MAJOR problem with no
> logical explanation, and is almost certainly the fault of PostgreSQL, because
> the database and contents have been identical across all the hosts, and some
> work beautifully with no tuning whatsoever; so I don't feel I'm wrong in
> placing blame...

I would personally strongly suggest turing on logging
on the PG server for about an hour, sifting through the runtimes for the queries and
finding which ones are taking all the time. I'd then run explain analyze and see what
is happening. I have heard you could get much better performance by rewriting some of
the dspam queries to use PG features. But I've never used dspam, so I can't verify that.

But a quick look through the dspam pg driver source...

/* Declare Cursor */
#ifdef VIRTUAL_USERS
strcpy (query, "DECLARE dscursor CURSOR FOR SELECT DISTINCT username FROM dspam_virtual_uids");
#else
strcpy (query, "DECLARE dscursor CURSOR FOR SELECT DISTINCT uid FROM dspam_stats");
#endif

If that's run often, it probably won't give the best performance, but that's a guess.
Again I'd suggest turning up the logging.

>
> All machines run Gentoo Linux. All have the same package versions. Disk I/O
> doesn't seem to be related - the 733MHz server had a 33MB/s IDE drive, the
> 2.4GHz server had a RAID 5 with 3 ultra320 drives: neither of those required
> any tuning. The new 3.0GHz has a mirror raid with 2 ultra320 drives, and the
> 3000+ that tuning fixed had an ultra160 disk not in a RAID.
>
> I really like PostgreSQL, and really don't want to use MySQL for dspam, but if
> I can't get this worked out ASAP I'm going to have to change for the sake of
> our customers. Any help is GREATLY appreciated!
Again I'd suggest turning up the logging.

>
> I'm online on instant messengers (contact IDs shown below), monitoring my
> email, and will be on #postgresql on Freenode.
>
> Cheers,

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message PFC 2005-06-07 12:53:54 Re: Need help to decide Mysql vs Postgres
Previous Message Tom Lane 2005-06-07 04:54:36 Re: Need help to decide Mysql vs Postgres