X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C882E476237 for ; Fri, 4 Apr 2003 10:29:43 -0500 (EST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id AB454476036 for ; Fri, 4 Apr 2003 10:29:39 -0500 (EST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 0939ED62D; Fri, 4 Apr 2003 07:29:44 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id F2DFB5C0A; Fri, 4 Apr 2003 07:29:43 -0800 (PST) Date: Fri, 4 Apr 2003 07:29:43 -0800 (PST) From: Stephan Szabo To: Robert John Shepherd Cc: Subject: Re: [BUGS] Rapid deteriation of performance (might be In-Reply-To: <001e01c2fabd$9edfb860$f3b0313e@LAIKA> Message-ID: <20030404072355.Q93368-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-26.6 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, QUOTE_TWICE_1,REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/56 X-Sequence-Number: 1562 On Fri, 4 Apr 2003, Robert John Shepherd wrote: > > > Up until a few days ago I have been running Postgresl 7.2.3 with > Tsearch > > > from the contrib dir, but at various times the performance of the > > > database would suddenly and rapidly deteriate so that queries which > > > previously took 500ms then took 8 or 9 seconds. > > > Hmm, what are the before and after explain analyze results? Also, > what > > are your conf settings for shared buffers, sort memory and the fsm > > parameters? > > shared_buffers = 40960 > sort_mem = 20480 > #max_fsm_relations = 1000 > #max_fsm_pages = 10000 > > As you can see I've not uncommented or touched the fsm parameters, I > have no idea what they do. Optimisation wise I have only played with > shared_buffers, sort_mem and max_connections. > > > > > The only cure is a backup and restore of the database > > > Did you do a regular vacuum or vacuum full? If only the former, it's > > possible that you need to either vacuum more frequently and/or raise > the > > free space map settings in your configuration file. > > I've been running this daily: > > vacuumdb -h localhost -a -z > > Should I be using the full switch then? Well, you generally shouldn't need to if the fsm settings are high enough. If you're doing really big updates like update each row of a 1 billion row table, you may end up having to do one immediately following that. Of course, if you're doing that, performance is probably not your biggest concern. ;) Explain analyze'll tell us if the system is changing plans (presumably to a worse one) - for example, deciding to move to a sequence scan because it thinks that the index scan is now to expensive, or conversely moving to an index scan because it thinks that there'll be too many reads, while those page reads actually are fairly localized. The vacuum full verbose should get some idea of how much empty space is there. > > pgsql-performance is a better list, so I've replied to there. You'll > > probably need to join in order to reply to list. > > Thanks, especially for not shouting at me heh, this is stressful enough > as it is. :)