Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 4FF989F9E2E for ; Thu, 30 Aug 2007 15:13:09 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 73894-04-5 for ; Thu, 30 Aug 2007 15:12:57 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id F396A9F9CFF for ; Thu, 30 Aug 2007 15:12:51 -0300 (ADT) Received: from server3.office.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 8FDDD6DB9A; Thu, 30 Aug 2007 19:07:20 +0100 (BST) Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 60E7C274052; Thu, 30 Aug 2007 19:07:20 +0100 (BST) Message-ID: <46D70758.6010507@archonet.com> Date: Thu, 30 Aug 2007 19:07:20 +0100 From: Richard Huxton User-Agent: Thunderbird 2.0.0.0 (X11/20070326) MIME-Version: 1.0 To: "Decibel!" Cc: Ruben Rubio , Bill Moran , Chris Mair , pgsql-performance@postgresql.org Subject: Re: [Solved] Postgres performance problem References: <46D2B879.6010308@rentalia.com> <46D2C4AF.8090501@1006.org> <20070827092935.be819c94.wmoran@collaborativefusion.com> <46D67730.10505@rentalia.com> <46D692CC.7010907@rentalia.com> <20070830173151.GP38801@decibel.org> In-Reply-To: <20070830173151.GP38801@decibel.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/395 X-Sequence-Number: 26525 Decibel! wrote: > On Thu, Aug 30, 2007 at 11:50:04AM +0200, Ruben Rubio wrote: >> As you may know, I do a vacuum full and a reindex database each day. I >> have logs that confirm that its done and I can check that everything was >> fine. >> >> So, this morning, I stopped the website, I stopped database, started it >> again. (I was around 200 days without restarting), then I vacuum >> database and reindex it (Same command as everyday) . Restart again, and >> run again the website. >> >> Now seems its working fine. But I really does not know where is the >> problem. Seems vacuum its not working fine? Maybe database should need >> a restart? I really don't know. > > No, it sounds to me like you just weren't vacuuming aggressively enough > to keep up with demand. Actually , I think it sounds like a stray long-lived transaction. Ruben - vacuum can't recover rows if another transaction might be able to see them. So, if you have a connection that issues BEGIN and sits there for 200 days you can end up with a lot of bloat in your database. Now, there's no way to prove that since you've restarted the database-server, but keep an eye on it. -- Richard Huxton Archonet Ltd