Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VoV54-0008JS-4V for pgsql-performance@arkaria.postgresql.org; Thu, 05 Dec 2013 09:18:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VoV53-00031C-K8 for pgsql-performance@arkaria.postgresql.org; Thu, 05 Dec 2013 09:18:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VoV52-000313-Sa; Thu, 05 Dec 2013 09:18:44 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VoV50-00038y-14; Thu, 05 Dec 2013 09:18:44 +0000 Received: from intern.anarazel.de (p5DDC41B8.dip0.t-ipconnect.de [93.220.65.184]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id AB89F4F0001; Thu, 5 Dec 2013 10:18:41 +0100 (CET) Date: Thu, 5 Dec 2013 10:18:41 +0100 From: Andres Freund To: Metin Doslu Cc: postgres performance list , pgsql-hackers , Amit Kapila , Claudio Freire Subject: Re: Parallel Select query performance and shared buffers Message-ID: <20131205091841.GE28793@alap2.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 2013-12-05 11:15:20 +0200, Metin Doslu wrote: > > - When we increased NUM_BUFFER_PARTITIONS to 1024, this problem is > > disappeared for 8 core machines and come back with 16 core machines on > > Amazon EC2. Would it be related with PostgreSQL locking mechanism? > > If we build with -DLWLOCK_STATS to print locking stats from PostgreSQL, we > see tons of contention with default value of NUM_BUFFER_PARTITIONS which is > 16: Is your workload bigger than RAM? I think a good bit of the contention you're seeing in that listing is populating shared_buffers - and might actually vanish once you're halfway cached.