Re: postgresql performace degrading after a while

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Ron Marom" <ron(at)bitband(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: postgresql performace degrading after a while
Date: 2006-01-30 14:57:37
Message-ID: 5098.1138633057@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Ron Marom" <ron(at)bitband(dot)com> writes:
> Indeed I forgot to mention that I AM vacuuming the database using a
> daemon every few hours; however this seems not to be the issue this
> time, as when the CPU consumptions went up I tried to vacuum manually
> and this seemed to take no affect.

This is not nearly often enough. You stated that the problem table
contains 67 records and all of them are updated every 30 seconds.
Therefore, after one hour the table contains 67 live records and
8040 dead ones, and a slowdown on the order of 100x is not exactly
surprising.

I would recommend vacuuming this specific table every five minutes or
less via a cron job. Or even fix that application daemon to issue
a vacuum after each time it updates the table --- if there are never
more than 67 dead rows then vacuuming won't take long.

After you update to 8.1 you might want to consider using autovacuum
instead of a hand-tuned cron script.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-01-30 15:12:27 Re: schema rename sequence issue
Previous Message Sim Zacks 2006-01-30 14:51:21 Re: schema rename sequence issue