postgresql_cluster
postgresql_cluster copied to clipboard
pgbouncer, pooler timeout (query_wait_timeout)
Hi, I installed it as "true". I created the database and user.
tail -f /var/log/pgbouncer/pgbouncer.log 2021-02-02 03:06:46.962 +03 [30376] WARNING C-0x563860fd9ef0: zabbix/[email protected]:49466 pooler error: query_wait_timeout
You may have specified too small pool_size which is not enough for your application, especially if you are using pool_mode: "session".
Always try to use pool_mode = transaction (you need to make sure your application supports transaction mode). This mode allows for more efficient reuse of pool connections.
pooler error: query_wait_timeout
Rather, it is due to a pgbouncer client session that is waiting for a server connection, but that wait took more than 2 minutes (https://www.pgbouncer.org/config.html#query_wait_timeout) In other words, all real-connections in a pool have been used, and some session was waiting around for 2 minutes to get an opportunity to run a query on the database.
There could be a number of factors causing this situation:
Session-level pooling - you may have several pgbouncer sessions that get real connections to the database, but are idle and never releasing a connection back to the pool. Then, the newest session just waits around and never gets a chance to run its query (and query_wait_timeout happens, and the new pgbouncer session is booted)
Transaction-level pooling, pool size too small - you may just have a lot of connections from applications and they spend a lot of time running a transaction, such that any new sessions are stuck waiting around for the transactions to finish, but 2 minutes was not enough time.
https://dba.stackexchange.com/questions/261709/pgbouncer-logging-details-for-query-wait-timeout-error
I leave the issue as open for information