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 1wB5qm-000jDs-16 for pgsql-general@arkaria.postgresql.org; Fri, 10 Apr 2026 07:00:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wB5qk-009zff-24 for pgsql-general@arkaria.postgresql.org; Fri, 10 Apr 2026 07:00:19 +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 1wB5qk-009zeT-0a for pgsql-general@lists.postgresql.org; Fri, 10 Apr 2026 07:00:19 +0000 Received: from mail-yx1-xb130.google.com ([2607:f8b0:4864:20::b130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wB5qi-00000000I1K-44FZ for pgsql-general@postgresql.org; Fri, 10 Apr 2026 07:00:18 +0000 Received: by mail-yx1-xb130.google.com with SMTP id 956f58d0204a3-6500eae6d2fso2288361d50.1 for ; Fri, 10 Apr 2026 00:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775804416; cv=none; d=google.com; s=arc-20240605; b=HXhKOGDh4bP3vBTKCn6jbRR20b3WEZEaBDdSh1JBaTEswhmmha3hjBQng+JRZ6CneW dAh1NeuJwSIh3zFgv1RVl6MjCfyKfB4XBohL5YKbC05ddirfDbCa4sgsDdAK23SfXNy2 IQB9/47mxgK8UUD7yVgHycmp6aAKrrTvYnjHHzPJ/KSfFdc7i5kyYdtcOJCXy1JiaJve r2uMfgQDKMpdePNgAAG+YVtiyfitXv9et0G1l+XpNSLnTaEpyHMeNIlbgdgmamxEI4Yi t8vGNdTRk+8Fa9f26DdDNngM9JU4wPSB4ERBqFMJ/4jwt74yZ+ieNWCzgWrtdZGCIwjX xQcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=e7mkHoF1M/p9nQn9xS6uLsIs1HSOUpKxGoviUMQZcoU=; fh=LOatJU9jqNKib293ozR++DXhH0tm9/krM+Q5e3cyFbw=; b=QE5NyKJfmBwSDljw6/h7OqdXu8/30fjoiWuKq11pgHUtR9jGlfcB8vG9zumBBoEFGC KACF46a2S5rx3FfkaW71FWAN7S1gXt2WrhnJbEaE+ZhOLpgHop5ivkaltvF0DPwMckFN OUpGZzEc31yV268gBpze7IXNneK4vZfCF0jOWTlxqNVqhm9sXsLnE5Ww/HgGLsqo//B1 Z/FoqPNcU/6Z1pH6rIPfUu+UBDK4TsyyQn6gRbau2kUjboEuujcn9Pdd7P/4XAOKu7ya xhLokb82yyKrAmJdyAb3dLsIErisHDrDx9beB9SLU7KiKJFXipBUDTTUvfNvCQlfpEcw lg6g==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775804416; x=1776409216; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=e7mkHoF1M/p9nQn9xS6uLsIs1HSOUpKxGoviUMQZcoU=; b=aiOcxN1h69NlSgnxHnJyQnfl3+jhGaofsMgq+bDyl5sa4zYjiccyNEAjze1VaJk7Kl GzazhRs8QkD7foM8ZFXA3E89eY38gkBtlNSgibAZlY1EXO17qtJB5kXRPXnI2BqgxrN2 WHdfuoTKkG4040G1U84mHFEEXIU1hl5xo100fCZd99kLVuCDV9e5UBcr9UIu9zxp+aFf NhfGlcQCImU1yWM7o5RNVmy+E4LR+T7QZ9uExmeV3gAx8sgKoArAF9x1ZP2REGPUWMW4 rbzVwBOmguxBaJ1fejLQQMipJAdnDvBiZuBGjwI/VCnELkHUO52VQHduL/AkUwgaar4a oHTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775804416; x=1776409216; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=e7mkHoF1M/p9nQn9xS6uLsIs1HSOUpKxGoviUMQZcoU=; b=AVdrmPrxaewF1V90T2A/QhFd0K76tCDTXY0kCC2Qsow7HNse5XXSBljeg88rhn4dLN ECLa/aHQptxQ2zqEoQKbscJHpeQb9GLIMXekFpkZSCYugPyIEeIAkCAXMW/uQ1txBxxi 422aO+ouExwhlrzNkPDI5Ju2LsdeO6xjXQCebFd3GwEGjucNhGMdsyHjXuVoRFtsbBKa 7G7YEhqqPBNVklkbOMSHWMysm5TB3pFsiY3QCob0bycc0uM6CuGMXhssDSsQa9ECmaai O8hbEl4YiKY7620tKUzXwzDsHszRlq38rEDahhSffXig4sqOIdMtstk/81oyztw42vEP 6reA== X-Gm-Message-State: AOJu0YwQNsCO6tW8KEwTdJQN5pBrcvrq6PqtkkeJ57kM2c0ry/iwErIZ ZYZJAPIta1h+hgFWU9UuARNLhKF+9nntxftiZzJuaocgelv+f4F0RtbfFr8NQ5xijQUcc2+mW/b +/hCGohB54Uo/s5ws+9kcGKsZsbojK3Y= X-Gm-Gg: AeBDiesiU/VI37Ve9u2bgPHH8aoZYOnzVjUG+dG3IS3kbHHkxuoxzuQW25l6pzH08As dOIl1PM/qijfbbl/SoUOJSxpib3ExKtKYktHCuVd52ILERPSbZDP+k2+8x3uATnzl5ASXg79R0X GRiLrBc/dEAT2I4bxW/eZ/7ecyh8RLDQfzmW0RgXXug5sbhw6UdkIu2MHwZQH8e1ceSzvvEmGwr lU3jfMq4PCd3zNYIRSteIua7O0Qp5/xOaTOLChUPeP260+0Xco4BOEUPyds6spJgY4uEp67Xphk jrgOpfZc X-Received: by 2002:a53:df4a:0:b0:64a:d04e:a340 with SMTP id 956f58d0204a3-65198a57036mr1226560d50.11.1775804416454; Fri, 10 Apr 2026 00:00:16 -0700 (PDT) MIME-Version: 1.0 References: <6b3cf69fa569d263a593cc2afe74dc35d29754eb.camel@cybertec.at> In-Reply-To: <6b3cf69fa569d263a593cc2afe74dc35d29754eb.camel@cybertec.at> From: KK CHN Date: Fri, 10 Apr 2026 12:37:22 +0530 X-Gm-Features: AQROBzDF64JKU9EtTUKDokhYUQxNYGBahFeTnO4boQc18X4YWw0UnZJwozfqcc4 Message-ID: Subject: Re: Pgbouncer and Node JS application Query read timeout error To: Laurenz Albe Cc: pgsql-general Content-Type: multipart/alternative; boundary="0000000000006ef34d064f15af2c" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000006ef34d064f15af2c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Apr 8, 2026 at 11:58=E2=80=AFAM Laurenz Albe wrote: > On Wed, 2026-04-08 at 10:51 +0530, KK CHN wrote: > > List, I am using pgbouncer(PgBouncer 1.23.1 RHEL 9.4) along with > Postgres16(RHEL 9.4) > > for connection pooling. > > > > Running a nodejs application which is throwing some errors related to > query timeout > > which the development team suspect after pgbouncer deployment > this behaviour appears, > > but not sure > > > > The error which is thrown from the nodejs logs as follows.. > > > > [image showing an error "Query read timeout"] > > > > Is this due to pgbouncer config issues or nodejs pool config issue= s > ? > > > > for reference here the pgbouncer config params and node js params a= t > present. > > > > pgbouncer.ini > > > > [...] > > [pgbouncer] > > pool_mode =3D transaction > > default_pool_size =3D 50 > > min_pool_size =3D 30 > > reserve_pool_size =3D 10 > > reserve_pool_timeout =3D 5 > > max_db_connections =3D 130 > > max_user_connections =3D 180 > > server_lifetime =3D 3600 > > server_idle_timeout =3D 600 > > [...] > > > The only way I can imagine that pgBouncer is leading to timeouts on the > client side > is if client sessions are waiting, because all connections are in use. > > You can run SHOW POOLS in the pgBouncer console to see if there are any > "cl_waiting". > If that is the case, you should configure the Node.js pools smaller, so > that no > connection has to wait. > Configuring Node.js pools smaller ? I couldn't get the logic here why advised to reduce the pool size ? Increasing pool size more than 10 adversely affects the connection establishment from Node.js application ? Since DB is having Pgbouncer infront and default_pool_size =3D 50 there , don't we have th= e freedom to increase node.js application pool size and it will help the query timeout ? or any hidden facts involved could you elaborate .. Thank you, Krishane > > Yours, > Laurenz Albe > --0000000000006ef34d064f15af2c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Wed, Apr 8, = 2026 at 11:58=E2=80=AFAM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
On Wed, 2026-04-08 at 10:51 +0530, KK CH= N wrote:
> List,=C2=A0I am using pgbouncer(PgBouncer 1.23.1 RHEL 9.4) along with= =C2=A0 Postgres16(RHEL 9.4)
> for connection pooling.=C2=A0 =C2=A0
>
> Running a nodejs application which is throwing some errors=C2=A0 relat= ed to query timeout
> which the development team suspect after pgbouncer deployment this=C2= =A0behaviour appears,
> but not sure=C2=A0
>
> The error which is thrown from=C2=A0 the nodejs logs as follows..=C2= =A0
>
> [image showing an error "Query read timeout"]
>
> Is this due to=C2=A0 =C2=A0pgbouncer config issues or=C2=A0 =C2=A0node= js=C2=A0 pool config issues ?
>
> for=C2=A0 reference here the pgbouncer=C2=A0 config params and=C2=A0 n= ode js=C2=A0 params at present.
>
> pgbouncer.ini
>
> [...]
> [pgbouncer]
> pool_mode =3D transaction
> default_pool_size =3D 50
> min_pool_size =3D 30
> reserve_pool_size =3D 10
> reserve_pool_timeout =3D 5
> max_db_connections =3D 130
> max_user_connections =3D 180
> server_lifetime =3D 3600
> server_idle_timeout =3D 600
> [...]


The only way I can imagine that pgBouncer is leading to timeouts on the cli= ent side
is if client sessions are waiting, because all connections are in use.

You can run SHOW POOLS in the pgBouncer console to see if there are any &qu= ot;cl_waiting".
If that is the case, you should configure the Node.js pools smaller, so tha= t no
connection has to wait.

Configuring Nod= e.js=C2=A0 pools smaller ?=C2=A0 I couldn't get the=C2=A0 logic here=C2= =A0 why advised to reduce the pool size ?=C2=A0
=C2=A0
= Increasing pool size=C2=A0 more than 10 adversely=C2=A0affects the connecti= on=C2=A0 establishment from Node.js=C2=A0 application=C2=A0?=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 Since DB=C2=A0 is having=C2=A0 =C2=A0Pgbouncer infront= =C2=A0and=C2=A0 =C2=A0default_pool_size =3D 50 there ,=C2=A0 don't we h= ave the freedom to increase node.js application pool size and it will help = the query timeout ?=C2=A0 =C2=A0or any hidden facts involved could you elab= orate ..


Thank you,
Krish= ane

=C2=A0

Yours,
Laurenz Albe
--0000000000006ef34d064f15af2c--