Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TTAQx-0007VT-0L for pgsql-performance@postgresql.org; Tue, 30 Oct 2012 11:56:39 +0000 Received: from mailout-us.gmx.com ([74.208.5.67] helo=mailout-us.mail.com) by makus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TTAQv-0001Rr-Aj for pgsql-performance@postgresql.org; Tue, 30 Oct 2012 11:56:38 +0000 Received: (qmail 31555 invoked by uid 0); 30 Oct 2012 11:55:57 -0000 Received: from 76.255.19.161 by rms-us011.v300.gmx.net with HTTP Content-Type: text/plain; charset="utf-8" Date: Tue, 30 Oct 2012 07:55:54 -0400 From: "Kevin Grittner" Message-ID: <20121030115554.306900@gmx.com> MIME-Version: 1.0 Subject: Re: How to keep queries low latency as concurrency increases To: "Catalin Iacob" ,pgsql-performance@postgresql.org X-Authenticated: #138763884 X-Flags: 0001 X-Mailer: GMX.com Web Mailer x-registered: 0 Content-Transfer-Encoding: 8bit X-GMX-UID: HaX9cIYW3zOlOQ09Lnwh8VV+IGRvb0B/ X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201210/372 X-Sequence-Number: 48331 Catalin Iacob wrote: > Hardware: > Virtual machine running on top of VMWare > 4 cores, Intel(R) Xeon(R) CPU E5645 @ 2.40GHz > 4GB of RAM You should carefully test transaction-based pools limited to around 8 DB connections. Experiment with different size limits. http://wiki.postgresql.org/wiki/Number_Of_Database_Connections > Disk that is virtual enough that I have no idea what it is, I know > that there's some big storage shared between multiple virtual > machines. Filesystem is ext4 with default mount options. Can you change to noatime? > pgbouncer 1.4.2 installed from Ubuntu's packages on the same > machine as Postgres. Django connects via TCP/IP to pgbouncer (it > does one connection and one transaction per request) and pgbouncer > keeps connections open to Postgres via Unix socket. The Python > client is self compiled psycopg2-2.4.5. Is there a good transaction-based connection pooler in Python? You're better off with a good pool built in to the client application than with a good pool running as a separate process between the client and the database, IMO. >  random_page_cost | 2 For fully cached databases I recommend random_page_cost = 1, and I always recommend cpu_tuple_cost = 0.03. -Kevin