Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 1E6A0650332 for ; Thu, 10 Jul 2008 12:37:26 -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 97431-03 for ; Thu, 10 Jul 2008 12:37:22 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.29]) by postgresql.org (Postfix) with ESMTP id D3EA2650162 for ; Thu, 10 Jul 2008 12:37:22 -0300 (ADT) Received: by yx-out-2324.google.com with SMTP id 8so953455yxb.73 for ; Thu, 10 Jul 2008 08:37:20 -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=UkfpaKXT6cY5ARlEli9KaV9NeZ2CaBFTS9ThF6KNd1U=; b=kYuWA5+MthcsZdYdCEWKZ0mTiQTBN1OEDO40dv+3Qir0Z9HVT+xWLtLXk6LsXKUXXc K5h+B1BAn9y00vss/oUDIAzvgP7sAT1HQWAwnWNiH6Lz85VRkd6m2QDt+1wRCggHgRS4 gYjjwwVlKzHebQtyv6nIy4qoAO4JhJjGF72Ss= 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=KwldpZw92fTuSAIW2N2KH6l3LjZNjATwvWDTRAZ4HwK6aPDliL7UeFaEUs+Hmp/dHy +rj15KoLySU6Q0kypjK75DZ358VjURaqqQnhnquqvLcZryVGOlGyFwT+SmauuQbYUABA 7SmE/giun4KuU85RGb1Qyn01+a5LbPoSYs7Co= Received: by 10.114.208.20 with SMTP id f20mr4236381wag.147.1215704239387; Thu, 10 Jul 2008 08:37:19 -0700 (PDT) Received: by 10.114.130.17 with HTTP; Thu, 10 Jul 2008 08:37:19 -0700 (PDT) Message-ID: Date: Thu, 10 Jul 2008 09:37:19 -0600 From: "Scott Marlowe" To: "Jessica Richard" Subject: Re: how big shmmax is good for Postgres... Cc: pgsql-performance@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: <639285.44246.qm@web56404.mail.re3.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200807/93 X-Sequence-Number: 30693 Some corrections: On Thu, Jul 10, 2008 at 6:11 AM, Scott Marlowe wrote: SNIP > If you commonly have 100 transactions doing that at once, then you > multiply much memory they use times 100 to get total buffer >> SPACE << in use, > and the rest is likely NEVER going to get used. > > In these systems, what seems like a bad idea, lowering the > buffer_size, might be the exact right call. > > For session servers and large transactional systems, it's often best > to let the OS do the best caching of the most of the data, and have > enough shared buffers to handle 2-10 times the in memory data set > size. This will result in a buffer size of a few hundred megabytes. > > The advantage here is that the (NOT OS) DATABASE doesn't have to spend a lot of time > maintaining a large buffer pool and checkpoints are cheaper. > The background writer can use spare >> CPU << and I/O cycles to write out > the now smaller number of dirty pages in shared_memory and the system runs > faster. > > Conversely, when you need large numbers of shared_buffers is when you > have something like a large social networking site. A LOT of people > updating a large data set at the same time likely need way more > shared_buffers to run well. A user might be inputing data for several > minutes or even hours. The same pages are getting hit over and over > too. For this kind of app, you need as much memory as you can afford > to throw at the problem, and a semi fast large RAID array. A large > >> RAID << cache means your RAID controller / array only have to write, on > average, as fast as the database commits. Just minor edits. If there's anything obviously wrong someone please let me know.