Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vjIiC-00Ca5x-0O for pgsql-general@arkaria.postgresql.org; Fri, 23 Jan 2026 15:04:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vjIiA-00090y-2Q for pgsql-general@arkaria.postgresql.org; Fri, 23 Jan 2026 15:04:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vjIiA-00090p-1I for pgsql-general@lists.postgresql.org; Fri, 23 Jan 2026 15:04:34 +0000 Received: from dverite2024.planet-service.net ([185.16.44.252] helo=mail.verite.pro) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vjIi7-001vUW-2j for pgsql-general@postgresql.org; Fri, 23 Jan 2026 15:04:33 +0000 Received: by mail.verite.pro (Postfix, from userid 1000) id 0460E2C9103; Fri, 23 Jan 2026 16:04:29 +0100 (CET) Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "Daniel Verite" Subject: Re: Pgbouncer performance query To: "KK CHN" Cc: "pgsql-general" In-Reply-To: Date: Fri, 23 Jan 2026 16:04:24 +0100 Message-Id: <64661152-e769-4771-82b1-e789d1dbfd27@manitou-mail.org> X-Mailer: Manitou v1.7.3 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk KK CHN wrote: > default_pool_size =3D 40 That limits the number of connections from pgBouncer to the database to 40. That's per user/database, but pgbench connects to the same database/same user. So when running pgbench -c 200, without pgBouncer there are 200 active connections, whereas through pgBouncer there are only 40 active connections in Postgres. When queries are issued to pgBouncer and the 40 connections are already busy, it makes them wait. That alone might explain why the average latencies are so different between pgBouncer and direct connections. If you really want to support 200 concurrent clients, increase the pool size accordingly. Best regards, --=20 Daniel V=E9rit=E9=20 https://postgresql.verite.pro/