public inbox for [email protected]  
help / color / mirror / Atom feed
PgBouncer-Postgres : un supported startup parameter statement_timeout
2+ messages / 2 participants
[nested] [flat]

* PgBouncer-Postgres : un supported startup parameter statement_timeout
@ 2025-07-16 07:22  KK CHN <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: KK CHN @ 2025-07-16 07:22 UTC (permalink / raw)
  To: [email protected]

Hi,

I am facing an issue with PgBouncer-Postgres setup,

*PgBouncer (PgBouncer 1.23.1 running on VM instance FreeBSD 14.2) and
PostgreSQL DB cluster on a virtual machine (PG version 16.0,  RHEL 9.4) *.


My application backend is nodeJS which throws the following Error in the
nodejs  console log: when connecting through pgbouncer to the backend
database server...

ERROR thrown:

my-node>* Failed to connect to PostgreSQL database transaction_db :
unsupported startup parameter: statement_timeout *{"code":"08P01",
"length":69, "name": "error", xx xx
my-node> error:[object Object ] {"timestamp":"15-07-2025 10:14:26"} x x xx


Note:   The nodejs apps  earlier directly establishing connections to the
 PostgreSQL DB ( no such errors)  now redirected via   Pgbouncer throws
this error.



*The config parameters for  pgbouncer as follows(correct me if any mistakes
made)*
[root@pgbouncer ~]# grep ^[^';;;'] /usr/local/etc/pgbouncer.ini
[databases]
transaction_db = host=dbmain.mydomain.com port=5444 dbname=transaction_db

[users]
[pgbouncer]
Logfile = /var/log/pgbouncer/pgbouncer.log
pidfile = /var/run/pgbouncer/pgbouncer.pid
listen_addr = *
listen_port = 5444
auth_type = md5
auth_file = /usr/local/etc/pgbouncer.users
admin_users = adminuser
stats_users = adminuser,
pool_mode = transaction
server_reset_query = DISCARD ALL
server_reset_query_always = 1
ignore_startup_parameters = extra_float_digits  // I have added this also
or can I add these options too in the following line  ?
;; ignore_startup_parameters = extra_float_digits, options,
statement_timeout, idle_in_transaction_session_timeout  // doubt options
supported in latest versions ?

max_client_conn = 5000   // can I give this much high value ?
default_pool_size = 20
min_pool_size = 10
reserve_pool_size = 10
reserve_pool_timeout = 5
max_db_connections = 100
max_user_connections = 30
server_lifetime = 3600
server_idle_timeout = 600 // is this a low value or need to be  increased ?
[root@pgbouncer ~]#



The config params of  N*odeJS application which uses nodejs connection
pooling in* code as follows

the Node JS application using the following  nodejs pooling configurations
for the application level

*cat app_10072025/config/pg-pool-config.js*
.......








*const poolOptions = {    max: 10,    min: 2,    idleTimeoutMillis: 600000,
  //Idle for 5Min    connectionTimeoutMillis: 10000,  //Reconnect 10sec
statement_timeout: 60000,    //Query executiion 1 min    acquire: 20000,
maxUses: 1000 //reconnect after 1000 queries};*

const pools = {

    transaction_db: new Pool({
        connectionString: `postgresql://${DB_USER}:${DB_PASSWORD}@
${DB_HOST}:${DB_PORT}/${DB_NAME_TRANSACTION_DB}`,
        ...poolOptions,
    }),
};

..................................

Any  hints   and suggestions in the config params are most welcome.

Thank you,
Krishane


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: PgBouncer-Postgres : un supported startup parameter statement_timeout
@ 2025-07-16 07:47  Robert Sjöblom <[email protected]>
  parent: KK CHN <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Robert Sjöblom @ 2025-07-16 07:47 UTC (permalink / raw)
  To: KK CHN <[email protected]>; +Cc: pgsql-general <[email protected]>

There's an option to ignore parameters in pgbouncer's config. Here's an SO
answer that gives an example: https://stackoverflow.com/a/36911794

On Wed, 16 Jul 2025, 09:19 KK CHN, <[email protected]> wrote:

> Hi,
>
> I am facing an issue with PgBouncer-Postgres setup,
>
> *PgBouncer (PgBouncer 1.23.1 running on VM instance FreeBSD 14.2) and
> PostgreSQL DB cluster on a virtual machine (PG version 16.0,  RHEL 9.4) *.
>
>
>
> My application backend is nodeJS which throws the following Error in the
> nodejs  console log: when connecting through pgbouncer to the backend
> database server...
>
> ERROR thrown:
>
> my-node>* Failed to connect to PostgreSQL database transaction_db :
> unsupported startup parameter: statement_timeout *{"code":"08P01",
> "length":69, "name": "error", xx xx
> my-node> error:[object Object ] {"timestamp":"15-07-2025 10:14:26"} x x xx
>
>
> Note:   The nodejs apps  earlier directly establishing connections to the
>  PostgreSQL DB ( no such errors)  now redirected via   Pgbouncer throws
> this error.
>
>
>
> *The config parameters for  pgbouncer as follows(correct me if any
> mistakes made)*
> [root@pgbouncer ~]# grep ^[^';;;'] /usr/local/etc/pgbouncer.ini
> [databases]
> transaction_db = host=dbmain.mydomain.com port=5444 dbname=transaction_db
>
> [users]
> [pgbouncer]
> Logfile = /var/log/pgbouncer/pgbouncer.log
> pidfile = /var/run/pgbouncer/pgbouncer.pid
> listen_addr = *
> listen_port = 5444
> auth_type = md5
> auth_file = /usr/local/etc/pgbouncer.users
> admin_users = adminuser
> stats_users = adminuser,
> pool_mode = transaction
> server_reset_query = DISCARD ALL
> server_reset_query_always = 1
> ignore_startup_parameters = extra_float_digits  // I have added this also
> or can I add these options too in the following line  ?
> ;; ignore_startup_parameters = extra_float_digits, options,
> statement_timeout, idle_in_transaction_session_timeout  // doubt options
> supported in latest versions ?
>
> max_client_conn = 5000   // can I give this much high value ?
> default_pool_size = 20
> min_pool_size = 10
> reserve_pool_size = 10
> reserve_pool_timeout = 5
> max_db_connections = 100
> max_user_connections = 30
> server_lifetime = 3600
> server_idle_timeout = 600 // is this a low value or need to be  increased ?
> [root@pgbouncer ~]#
>
>
>
> The config params of  N*odeJS application which uses nodejs connection
> pooling in* code as follows
>
> the Node JS application using the following  nodejs pooling configurations
> for the application level
>
> *cat app_10072025/config/pg-pool-config.js*
> .......
>
>
>
>
>
>
>
>
> *const poolOptions = {    max: 10,    min: 2,    idleTimeoutMillis:
> 600000,   //Idle for 5Min    connectionTimeoutMillis: 10000,  //Reconnect
> 10sec    statement_timeout: 60000,    //Query executiion 1 min    acquire:
> 20000,    maxUses: 1000 //reconnect after 1000 queries};*
>
> const pools = {
>
>     transaction_db: new Pool({
>         connectionString: `postgresql://${DB_USER}:${DB_PASSWORD}@
> ${DB_HOST}:${DB_PORT}/${DB_NAME_TRANSACTION_DB}`,
>         ...poolOptions,
>     }),
> };
>
> ..................................
>
> Any  hints   and suggestions in the config params are most welcome.
>
> Thank you,
> Krishane
>

-- 
Innehållet i detta e-postmeddelande är konfidentiellt och avsett endast för 
adressaten.Varje spridning, kopiering eller utnyttjande av innehållet är 
förbjuden utan tillåtelse av avsändaren. Om detta meddelande av misstag 
gått till fel adressat vänligen radera det ursprungliga meddelandet och 
underrätta avsändaren via e-post


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2025-07-16 07:47 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-07-16 07:22 PgBouncer-Postgres : un supported startup parameter statement_timeout KK CHN <[email protected]>
2025-07-16 07:47 ` Robert Sjöblom <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox