public inbox for [email protected]  
help / color / mirror / Atom feed
From: Bo Peng <[email protected]>
To: Bob Ross <[email protected]>
To: [email protected] <[email protected]>
Subject: Re: SQL query latency when using pgPool (v4.6.2)
Date: Fri, 17 Oct 2025 07:42:04 +0000
Message-ID: <TYWP286MB263346EDD0F451CE5C8067BAF2F6A@TYWP286MB2633.JPNP286.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <CAHtZvrdvvk5YyyQMYoaE-2SY6J0SMQgLSgU1FvztGnAKLPRMLg@mail.gmail.com>
References: <CAHtZvrdvvk5YyyQMYoaE-2SY6J0SMQgLSgU1FvztGnAKLPRMLg@mail.gmail.com>

Hi,

Thank you for your question.

Could you please share the cluster configuration?
(For example, the number of nodes, Pgpool-II/PostgreSQL versions, and whether pgpool and PostgreSQL are running on the same host.)

Also, could you please share your pgpool.conf file and the pgpool logs?

---
Bo Peng <[email protected]>
SRA OSS K.K.
TEL: 03-5979-2701 FAX: 03-5979-2702
Mobile: 080-7752-0749
URL: https://www.sraoss.co.jp/


________________________________________
差出人: Bob Ross <[email protected]>
送信: 2025 年 10 月 8 日 (水曜日) 15:30
宛先: [email protected] <[email protected]>
件名: SQL query latency when using pgPool (v4.6.2)




Hello,
I am currently testing SQL query performance using PgPool (v4.6.2) as a load balancer, and I am observing approximately 18–20 ms latency between SQL statements within the same transaction. Execution time on the PostgreSQL backend servers is less than 0.5 ms.
It’s important to note that both the application and database servers are located in the same cloud region, with network latency below 1 ms. PgPool is colocated with the PostgreSQL backend servers.
For example, when executing a transaction containing 10 SQL statements, the total execution time through pgPool is about 200 ms, as confirmed by both application and pgPool logs. The delay consistently occurs between the “Execute” and “Parse” phases. When connecting directly to the PostgreSQL backends, the same transaction completes in about 10 ms, with roughly 1 ms between SQL statements.
We have tested the following configurations:
- Switched from the extended query protocol to the simple query protocol — for some queries this reduced inter-query latency to 2–3 ms, but for others it increased to 30–40 ms due to additional parsing overhead.
- Adjusted various PgPool parameters related to load balancing and connection pooling (e.g., load_balance_mode, statement_level_load_balance, serialize_accept, disable_load_balance_on_write) and enabled debug logging, but none of these changes brought a significant improvement.
Could you please advise whether there are additional pgPool parameters or tuning approaches that could help improve throughput and reduce latency in extended query protocol? 
Thank you,
Bob


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: SQL query latency when using pgPool (v4.6.2)
  In-Reply-To: <TYWP286MB263346EDD0F451CE5C8067BAF2F6A@TYWP286MB2633.JPNP286.PROD.OUTLOOK.COM>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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