Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UXXm3-0005sE-BT for pgsql-performance@arkaria.postgresql.org; Wed, 01 May 2013 14:12:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UXXm2-0002CS-N3 for pgsql-performance@arkaria.postgresql.org; Wed, 01 May 2013 14:12:46 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UXXm1-0002CM-Kk for pgsql-performance@postgresql.org; Wed, 01 May 2013 14:12:45 +0000 Received: from proofpoint2.mail.rice.edu ([128.42.201.101] helo=pp2.rice.edu) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UXXlu-0007mg-Rs for pgsql-performance@postgresql.org; Wed, 01 May 2013 14:12:44 +0000 Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.14.5/8.14.5) with SMTP id r41BitXO029099; Wed, 1 May 2013 09:12:36 -0500 Received: from mh2.mail.rice.edu (mh2.mail.rice.edu [128.42.201.21]) by pp2.rice.edu with ESMTP id 1bwysb42we-1; Wed, 01 May 2013 09:12:36 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh2.mail.rice.edu, auth channel X-SMTP-Auth: no X-SMTP-Auth: no Received: from aart.rice.edu (aart.rice.edu [168.7.56.48]) by mh2.mail.rice.edu (Postfix) with ESMTP id C5F9D5002D8; Wed, 1 May 2013 09:12:36 -0500 (CDT) Received: by aart.rice.edu (Postfix, from userid 18612) id BBFA11006EE; Wed, 1 May 2013 09:12:36 -0500 (CDT) Date: Wed, 1 May 2013 09:12:36 -0500 From: "ktm@rice.edu" To: Anne Rosset Cc: "pgsql-performance@postgresql.org" Subject: Re: Deterioration in performance when query executed in multi threads Message-ID: <20130501141236.GG27807@aart.rice.edu> References: <9A6B86D66BD3C2438AFACFA09354890F20A2DF6D@EXCH01.sp.corp.collab.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9A6B86D66BD3C2438AFACFA09354890F20A2DF6D@EXCH01.sp.corp.collab.net> User-Agent: Mutt/1.5.20 (2009-12-10) X-Pg-Spam-Score: -4.5 (----) 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 Wed, May 01, 2013 at 02:05:06PM +0000, Anne Rosset wrote: > Hi all, > We are running a stress test that executes one select query with multiple threads. > The query executes very fast (10ms). It returns 100 rows. I see deterioration in the performance when we have multiple threads executing the query. With 100 threads, the query takes between 3s and 8s. > > I suppose there is a way to tune our database. What are the parameters I should look into? (shared_buffer?, wal_buffer?) > > Thanks for your help, > Anne Try a connection pooler like pgbouncer to keep the number of simultaneous queries bounded to a reasonable number. You will actually get better performance. Regards, Ken -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance