Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 85A5764FD15 for ; Fri, 12 Sep 2008 14:26:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 81501-09 for ; Fri, 12 Sep 2008 14:26:46 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.178]) by postgresql.org (Postfix) with ESMTP id 900DF64FD14 for ; Fri, 12 Sep 2008 14:26:46 -0300 (ADT) Received: by wa-out-1112.google.com with SMTP id n4so559542wag.5 for ; Fri, 12 Sep 2008 10:26:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=pRyLdW4Kxfk66AzefCJApWM7t1xHAySDe0X/e3Ca8yo=; b=E8irPDkT4vPQ3z4EnbSIesf5PgeuNt4xtcHLRC56P8l0Jtbryhl2MPwj3qTWjV5W7S V7Gc+uyLjByCtnqSU8qduSInB6oiaooS0KstQFEfVNa0orItyd4Lkx3AkcONRaP0a1SF CRbJ3cpdrGXvWeGkZrirj7aawwXBn/YOJxj4w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=R5fb7kr7MkaIQQSS5/5ZAWhvOpUs5shwX+DX4fxjxruI+1ur6dJgTxqoKz8NHm6cCT yr1B/r9wpCtJcp9twIWguccJtYnC7gUfUEbgC7ZnG4ecKj+kq0QES0qr9PfUlHyRa++u Upo6BQ1LFzaf79yrdIel99vKjSNjCGkTNiynQ= Received: by 10.141.113.6 with SMTP id q6mr2796504rvm.36.1221240405187; Fri, 12 Sep 2008 10:26:45 -0700 (PDT) Received: by 10.141.74.11 with HTTP; Fri, 12 Sep 2008 10:26:45 -0700 (PDT) Message-ID: Date: Fri, 12 Sep 2008 11:26:45 -0600 From: "Scott Marlowe" To: "Barbara Stephenson" Subject: Re: Recommend dba maintenance tasks on a regular bases Cc: pgsql-admin@postgresql.org In-Reply-To: <200809121149.46137.barbara@turbocorp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200809121149.46137.barbara@turbocorp.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/119 X-Sequence-Number: 30212 On Fri, Sep 12, 2008 at 9:49 AM, Barbara Stephenson wrote: > Hello, > > We are currently using Postgresql 8.3.3 on Red Hat 4 and our largest database > is around 8454 MB. > > I have recommend the below to my group but not sure if reindexing should be > involved since autovacuum is on? > > How can I be sure auto vacumming is working fine? We haven't had any problems > plus I do a query and it does list all the tables and shows the last update > of auto vacuum and auto analyze. Is that it? > > > 1- pg_dump - binary dump every midday and nightly If uptime is critical, also look at setting up a PITR server. > 2 - auto vacuum > autovacuum = on > log_autovacuum_min_duration = 0 > autovacuum_max_workers = 3 > autovacuum_naptime = 1min > autovacuum_vacuum_threshold = 50 > autovacuum_vacuum_scale_factor = 0.2 > autovacuum_analyze_scale_factor = 0.1 What's your autovacuum sleep? 10 to 20 is pretty reasonable. If you set it much higher autovacuum may not run fast enough to keep up. Run regular vacuum verbose on the database and examine the last 20 or so lines (need to be superuser I think) to see how many free space map slots you need. FSM slots are super cheap (6 bytes each) but they do come from shared memory. A good setting for a database in your size range with high updates will be between the default 200k or so to 1M. > 3- rotate data logs pgsql has this ability built in, as does your OS. I prefer letting pgsql log as I like the options better than syslog, plus it seems to be faster. Also, don't forget to add long term periodic maintenance. Things like taking the server down every 6 or 12 months to blow out dust, run memory and drive tests, etc...