Re: DB is slow until DB is reloaded

From: Madison Kelly <linux(at)alteeve(dot)com>
To: Brad Nicholson <bnichols(at)ca(dot)afilias(dot)info>
Cc: Gary Doades <gpd(at)gpdnet(dot)co(dot)uk>, pgsql-performance(at)postgresql(dot)org
Subject: Re: DB is slow until DB is reloaded
Date: 2010-01-04 21:33:07
Message-ID: 4B425E93.1050207@alteeve.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Brad Nicholson wrote:
> I think you are going down the wrong route here - you should be looking
> at preventative maintenance instead of fixing it after its broken.
>
> Ensure that autovacuum is running for the database (assuming that you
> are on a relatively modern version of PG), and possibly tune it to be
> more aggressive (we can help).
>
> This will ensure that the condition never comes up.
>
> ps - if you do go with the route specify, no need to VACUUM after the
> CLUSTER. CLUSTER gets rid of the dead tuples - nothing for VACUUM to
> do.
>

I wanted to get ahead of the problem, hence my question here. :) I've
set this to run at night ('iwt' being the DB in question):

su postgres -c "psql iwt -c \"VACUUM ANALYZE VERBOSE\"

I will keep an eye on the output for a little while (it appends to a
log) and see what it says. Also, I read that CLUSTER can mess up back
ups as it makes tables look empty while running. If the above doesn't
seem to help, I will swap out the VACUUM and run a CLUSTER before the
ANALYZE and see how that works.

Madi

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Steve Crawford 2010-01-04 21:43:02 Re: DB is slow until DB is reloaded
Previous Message Madison Kelly 2010-01-04 21:28:25 Re: DB is slow until DB is reloaded