Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 69E5163351B for ; Mon, 2 Nov 2009 08:52:00 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 79818-02 for ; Mon, 2 Nov 2009 12:51:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from fw2.prolan.hu (fw2.prolan.hu [193.68.50.107]) by mail.postgresql.org (Postfix) with ESMTP id E9E9B6330D8 for ; Mon, 2 Nov 2009 08:51:51 -0400 (AST) Received: from fw2.prolan.hu (localhost.localdomain [127.0.0.1]) by localhost (Postfix) with ESMTP id 2D718818CBE; Mon, 2 Nov 2009 13:51:49 +0100 (CET) Received: from saturn.intranet.prolan.hu (ftp.prolan.hu [193.91.83.252]) by fw2.prolan.hu (Postfix) with ESMTP id 2308C8180C7; Mon, 2 Nov 2009 13:51:49 +0100 (CET) Received: from localhost ([193.91.83.68]) by saturn.intranet.prolan.hu with Microsoft SMTPSVC(6.0.3790.3959); Mon, 2 Nov 2009 13:50:54 +0100 Received: from pme by localhost with local (Exim 4.69) (envelope-from ) id 1N4wN4-0008N9-J3; Mon, 02 Nov 2009 13:50:54 +0100 Date: Mon, 2 Nov 2009 13:50:54 +0100 From: Peter Meszaros To: Scott Marlowe Cc: pgsql-performance@postgresql.org Subject: Re: database size growing continously Message-ID: <20091102125054.GA25608@pme.intranet.prolan.hu> References: <20091029144405.GA3755@pme.intranet.prolan.hu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailer: Mutt http://www.mutt.org/ X-URL: http://www.prolan.hu X-Accept-Language: hu,en X-Editor: Vim http://www.vim.org/ X-Location: Europe, Hungary, =?utf-8?Q?Budakal=E1sz?= User-Agent: Mutt/1.5.20 (2009-06-14) X-OriginalArrivalTime: 02 Nov 2009 12:50:54.0581 (UTC) FILETIME=[1D85F250:01CA5BBB] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200911/10 X-Sequence-Number: 36178 Thank you all for the fast responses! I changed the delete's schedule from daily to hourly and I will let you know the result. This seems to be the most promising step. The next one is tuning 'max_fsm_pages'. Increasing max_fsm_pages can be also helpful, but I've read that 'vacuum verbose ...' will issue warnings if max_fsm_pages is too small. I've never seen such messag, this command is either run and finish or goes to an endless loop as it was written in my initial e-mail. On Thu, Oct 29, 2009 at 10:59:48AM -0600, Scott Marlowe wrote: > On Thu, Oct 29, 2009 at 8:44 AM, Peter Meszaros wrote: > > Hi All, > > > > I use postgresql 8.3.7 as a huge queue. There is a very simple table > > with six columns and two indices, and about 6 million records are > > written into it in every day continously commited every 10 seconds from > > 8 clients. The table stores approximately 120 million records, because a > > cron job daily deletes those ones are older than 20 day. Autovacuum is > > on and every settings is the factory default except some unrelated ones > > (listen address, authorization). But my database is growing, > > characteristically ~600MByte/day, but sometimes much slower (eg. 10MB, > > or even 0!!!). > > Sounds like you're blowing out your free space map. Things to try: > > 1: delete your rows in smaller batches. Like every hour delete > everything over 20 days so you don't delete them all at once one time > a day. > 2: crank up max fsm pages large enough to hold all the dead tuples. > 3: lower the autovacuum cost delay > 4: get faster hard drives so that vacuum can keep up without causing > your system to slow to a crawl while vacuum is running. -- E-mail: pmeATprolanDOThu Phone: +36-20-954-3100/8139 Mobile: +36-20-9543139 Fax: +36-26-540420 http://www.prolan.hu Mon Nov 2 13:20:39 CET 2009