Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id C4FF464FC6F for ; Mon, 24 Nov 2008 17:24:52 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 33535-08 for ; Mon, 24 Nov 2008 17:24:49 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from qb-out-0506.google.com (qb-out-0506.google.com [72.14.204.227]) by mail.postgresql.org (Postfix) with ESMTP id CA14664FC44 for ; Mon, 24 Nov 2008 17:24:49 -0400 (AST) Received: by qb-out-0506.google.com with SMTP id d8so2310837qbc.23 for ; Mon, 24 Nov 2008 13:24:48 -0800 (PST) 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=I1JGGdD6ywsj1rcHQouPJ0OKbPp/Bc9vL6SLvfhif08=; b=IN3YQ91CLy0pJzzywMHPUCnjQU8o3lZg8DZC7bvIovWcHx1QpgCsIqgvi3mq21Ht9s 8tNYzsLwngWVgLdpnZOqKLKUJW4AZX2qGChspnGTOlFJhKIAu6ilXoPGA1hlBxStrpHm lEsAodktG2l5zhyGxouepdelgti/IS+V1HoBc= 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=AjeObZPcAn/uCFTPv6Nh+2hXHc5jPB3HTad7TY1g36Y3MQtMVsFvG43yqli7X+R6ky zVEkqZ1KC/kv0b7xFngBBUcEtzb+UI5Z6kqysw64BEXFqH6w6bq0E6Ld/HRoOUX4b+MG l0Gtvtq/jE/oP9pmiE4tVKMnWfOoA2wDt4MLg= Received: by 10.114.39.5 with SMTP id m5mr2130895wam.214.1227561888051; Mon, 24 Nov 2008 13:24:48 -0800 (PST) Received: by 10.114.137.17 with HTTP; Mon, 24 Nov 2008 13:24:47 -0800 (PST) Message-ID: Date: Mon, 24 Nov 2008 14:24:47 -0700 From: "Scott Marlowe" To: "Brad Nicholson" Subject: Re: Monitoring buffercache... Cc: "Kevin Kempter" , pgsql-performance@postgresql.org In-Reply-To: <1227556326.18990.98.camel@bnicholson-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200811241143.57182.kevin@kevinkempterllc.com> <1227556326.18990.98.camel@bnicholson-desktop> 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: 200811/245 X-Sequence-Number: 31976 On Mon, Nov 24, 2008 at 12:52 PM, Brad Nicholson wrote: >> I just ran it in a loop over and over on my 8 core opteron server and >> it ran the load factor up by almost exactly 1.0. Under our normal >> daily load, it sits at 1.9 to 2.5, and it climbed to 2.9 under the new >> load of running that query over and over. So, it doesn't seem to be >> blocking or anything. > > The internal docs for pg_buffercache_pages.c state: > > "To get a consistent picture of the buffer state, we must lock all > partitions of the buffer map. Needless to say, this is horrible > for concurrency. Must grab locks in increasing order to avoid > possible deadlocks." Well, the pg hackers tend to take a parnoid view (it's a good thing TM) on things like this. My guess is that the period of time for which pg_buffercache takes locks on the buffer map are short enough that it isn't a real big deal on a fast enough server. On mine, it certainly had no real negative effects for the 5 minutes or so it was running in a loop. None I could see, and we run hundreds of queries per second on our system. Of course, for certain other types of loads it could be a much bigger issue. But for our load, on our machine, it was virtually unnoticeable.