SQL query latency when using pgPool (v4.6.2)

From: Bob Ross <bob(dot)ross(dot)19821(at)gmail(dot)com>
To: pgpool-general(at)lists(dot)postgresql(dot)org
Subject: SQL query latency when using pgPool (v4.6.2)
Date: 2025-10-08 06:30:50
Message-ID: CAHtZvrdvvk5YyyQMYoaE-2SY6J0SMQgLSgU1FvztGnAKLPRMLg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-general

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

Responses

Browse pgpool-general by date

  From Date Subject
Next Message Bo Peng 2025-10-10 06:57:39 Re: Support for RHEL/Rocky Linux 10
Previous Message zam bak 2025-10-06 12:41:28 Re: Support for RHEL/Rocky Linux 10