Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id F28F79FB1DF for ; Tue, 28 Nov 2006 07:34:56 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 81877-03 for ; Tue, 28 Nov 2006 07:34:43 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mx00.pub.collaborativefusion.com (mx00.pub.collaborativefusion.com [206.210.89.199]) by postgresql.org (Postfix) with ESMTP id 9CE679FA8EF for ; Tue, 28 Nov 2006 07:34:44 -0400 (AST) Received: from working (c-71-60-174-60.hsd1.pa.comcast.net [71.60.174.60]) (AUTH: LOGIN wmoran, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by wingspan with esmtp; Tue, 28 Nov 2006 06:34:41 -0500 id 00056437.456C1ED1.0000F956 Date: Tue, 28 Nov 2006 06:34:39 -0500 From: Bill Moran To: Bruno Wolff III Cc: Michael Simms , pgsql-performance@postgresql.org Subject: Re: BUG #2784: Performance serious degrades over a period Message-Id: <20061128063439.0311f002.wmoran@collaborativefusion.com> In-Reply-To: <20061128042627.GA17575@wolff.to> References: <200611261635.kAQGZqKE025405@wwwmaster.postgresql.org> <20061128042627.GA17575@wolff.to> Organization: Collaborative Fusion Inc. X-Mailer: Sylpheed version 2.2.9 (GTK+ 2.10.6; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/248 X-Sequence-Number: 22018 Bruno Wolff III wrote: > > This really should have been asked on pgsql-performance and would probably > get a better response there.. > > On Sun, Nov 26, 2006 at 16:35:52 +0000, > Michael Simms wrote: > > PostgreSQL version: 8.1.4 > > Operating system: Linux kernel 2.6.12 > > Description: Performance serious degrades over a period of a month > > Details: > > > > OK, we have a database that runs perfectly well after a dump and restore, > > but over a period of a month or two, it just degrades to the point of > > uselessness. > > vacuumdb -a is run every 24 hours. We have also run for months at a time > > using -a -z but the effect doesnt change. > > > > This sounds like you either need to increase your FSM setting or vacuum > more often. I think vacuumdb -v will give you enough information to tell > if FSM is too low at the frequency you are vacuuming. > > > The database is for a counter, not the most critical part of the system, but > > a part of the system nonetheless. Other tables we have also degrade over > > time, but the counter is the most pronounced. There seems to be no common > > feature of the tables that degrade. All I know is that a series of queries > > that are run on the database every 24 hours, after a dump/restore takes 2 > > hours. Now, 2 months after, it is taking over 12. We are seriously > > considering switching to mysql to avoid this issue. > > You probably will want to vacuum the counter table more often than the other > tables in the database. Depending on how often the counter(s) are being > updated and how many separate counters are in the table you might want to > vacuum that table as often as once a minute. > > Depending on your requirements you might also want to consider using a sequence > instead of a table row for the counter. Just to throw it in to the mix: you might also be in a usage pattern that would benefit from a scheduled reindex every so often.