Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 2306C650ED3 for ; Thu, 3 Jul 2008 21:40:21 -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 94146-01-9 for ; Thu, 3 Jul 2008 21:39:57 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.234]) by postgresql.org (Postfix) with ESMTP id 2F7D3650EDF for ; Thu, 3 Jul 2008 21:38:18 -0300 (ADT) Received: by rv-out-0506.google.com with SMTP id b25so1403734rvf.43 for ; Thu, 03 Jul 2008 17:38:16 -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=WKBo1QS6h0WjYdLBI+hWUw9AZ1QfeLOrglJ+z2SNbxw=; b=w1eWUAh/NjWJMgHgAcVL1J9DnrhgFeLAxaiVR7BMjyGFeoS9Ez/7ndJ3hJk8QVQHvB f45Dbg7o1x1UDmMUiN+fdmjEV5w6dEF3u4rA/f+6Sn/kzGG32Tw5nbpR4RFGO5FV0Kg5 FuKgIEsINxRF0VawuokanmJ2Yg3qdBOHIF/1I= 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=v0x8RsdLQOIRRMgBacI+HoK6LWKrhrAYDJsjDFDZFwpPRAJMtppxUA/OzYNA671kLY KHeed1/3qWq595aVAf/fvulWlOSQPaGbpC9G3MxvEd6gbAPrV5bNfCmCUPmZHekOju7i mC7/1unrUmL6TP0eDilzdDBeqE3g/+tntN4O4= Received: by 10.114.158.1 with SMTP id g1mr1922205wae.111.1215131894922; Thu, 03 Jul 2008 17:38:14 -0700 (PDT) Received: by 10.114.180.17 with HTTP; Thu, 3 Jul 2008 17:38:14 -0700 (PDT) Message-ID: Date: Thu, 3 Jul 2008 18:38:14 -0600 From: "Scott Marlowe" To: "Steve Kecskes" Subject: Re: Recourse Usage Cc: pgsql-admin@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200807/59 X-Sequence-Number: 29669 On Thu, Jul 3, 2008 at 5:28 PM, Steve Kecskes wrote: > > G'day, > > I have been tasked to tune our company's Postgres database. From the > research I have done I feel the recourse consumption parameters are set far > to low. I have come up with the following modifications to the > configuration and wanted to run this by the mailing list for any > suggestions. The database is on a semi dedicated box, shared only with > memcached which has been allocated 512MB. > > -Dual Xeon 2.33GHz > -4GB RAM > -Twin SAS drives in RAID 1 > > Shared Buffers > Currently: 8192 pages @ 8 KB each // 64MB > To be set to: (256MB - 32768 pages @ 8 KB each) That's still pretty small. I'd look at setting it to 1G on a machine with that much memory. > Work Mem > Currently: 1024kb > To be set to: 1536kb This setting is very dependent on how man connections you'll support. If only a few users will ever connect, then you can easily set it to 16 to 64 Megs and be ok. If you'll have dozens to hundreds of users keep in mind that work_mem limits the amount of memory each sort type function can use in each query for each user so it can add up fast. Generally most systems can handle 8M or so for work_mem fine. > > Effective Cache Size > Currently: 50000 pages // 390MB > To be set to: 128000 pages // 1000MB Probably also too low. That machine is quite likely to have 2+g of kernel cache and buffer. But this is a course tuning knob so it's not a huge deal. > Random Page Cost > Currently: 4.0 > To be set to: 3.0 > > Wal Buffers > Currently: 8 @ 8kb each > To be set to: 32 @ 8kb each Both of these are fine. I assume you're running at least 8.0 or above here. I would highly recommend upgrading to 8.3 if you're on 8.1 or older due to the fact that 8.3 is so much faster than the older versions.