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.94.2) (envelope-from ) id 1v6Nqb-003gyB-66 for pgpool-general@arkaria.postgresql.org; Wed, 08 Oct 2025 06:40:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v6NqY-0085mP-RJ for pgpool-general@arkaria.postgresql.org; Wed, 08 Oct 2025 06:40:23 +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.94.2) (envelope-from ) id 1v6NhW-00829j-Ip for pgpool-general@lists.postgresql.org; Wed, 08 Oct 2025 06:31:03 +0000 Received: from mail-ua1-x934.google.com ([2607:f8b0:4864:20::934]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v6NhU-000cjR-2i for pgpool-general@lists.postgresql.org; Wed, 08 Oct 2025 06:31:02 +0000 Received: by mail-ua1-x934.google.com with SMTP id a1e0cc1a2514c-890190c7912so2975095241.2 for ; Tue, 07 Oct 2025 23:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1759905061; x=1760509861; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=+2IlI4AS6QgOITVP099tQiWa9ElQmSomu3JSf3OhVf8=; b=E+LzKch8LWAstM/Obl5GcD01WjZ+QQ1biwGNVjUek21VgWDvJvZXGHYPVMdJPgDRdr DlGZAbvIsK7hrGW2FCJuBiBSLED8KKHJA5x4UVrFMSjvzc6dvDdXjOYGqDPvIBm/EYeS YSQzHR90513N67iUIEQdlXjv7/yDjWgAkzBc7VWqGgcnyV1xev1VQ7qrbyEnZWExgCOn rpUdTd74jEJgxw71EeqBFBRFrHIiFKKMUROmqk8FNJyd+U3s+juzVLjVIvc0d2WDukLJ ssIwSQX+pbN5Nx0C88B5AYPjgKBmClseS1yvZV+1WkQ/pS7XW22Lx0Ef4ZTfvIzEgrET cS7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759905061; x=1760509861; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=+2IlI4AS6QgOITVP099tQiWa9ElQmSomu3JSf3OhVf8=; b=S7EkmvRQ72zI0h+nsUpzCXDPVWYAS+L+2Xnqr82WZowdFj3o1NsqgJSk7iqG3gdjQh mgCVBQCEOC5hwAexT9yf/qvSX98Kg8mPNA718t2EjUm0yaHUVin5Hi0uafJbGXp7btrK FPecU8wEDeXZ9FTaSGyWM+/n0nq0h9sJOkPEOxG0P9J6wc6RFIV17KCOk3L9ugTL3GBQ CLipwXx65NFRy8MW+AhcRETSX6Mo9tn04tv+YrF7apnDQCLdlMnE05ETdZfkZiUIF8Sc Y3JDGPNZWSmMFco2lCLYakG+taTLNGyNQZI39PqIRHpY5mnQ5CxIYpaaKkep/+fJezfj /iyQ== X-Gm-Message-State: AOJu0Yy1B/qEzqk5azBvTNeTe6De0Y+POOkEn/IEKvcAQ+jaz6zOmJBt X80QaQH+6b1QcQ4zzSpbLLvlXz5Rc7u6pm0gKjjxGeEg9miiCysuZjiszYn6Wwy28ZB8V2qUlku JOzQ45VOPwSLg7x+RxzTs+JnG/oM3MocNMYNaSDvWp8bE X-Gm-Gg: ASbGncscahMYWp+YyeyknZQZeWl2iHoGLDV/XDhFR7rDwZWk9XdwDBji00EcYp+txEn YRQKduCyO0vakk/9Y9xXrG6y1xiVlPx0PWwfeJBcID6MiABVe/Q4cOtYntaM+opOVT380OYD6k5 /AICqGmMJuprobNK3US6refii3wTH+ZOJfLTiN6S0gNxSiwQCw0AJDU+FWIfHLATPO+R1OTdni1 KJ84hwAqI6Fhc+kzF0yn8XKyEcqcc8= X-Google-Smtp-Source: AGHT+IFlQ1wJ71Mvsy0xJ786+oXlSUukSyeAJecKW/+ASwiZ9q3fhJrJrxvWEZ7De1nSk4MebUZoZGbaKfbeOf9newA= X-Received: by 2002:a05:6102:4191:b0:525:33a9:c71 with SMTP id ada2fe7eead31-5d5e23aa6bbmr745057137.24.1759905060748; Tue, 07 Oct 2025 23:31:00 -0700 (PDT) MIME-Version: 1.0 From: Bob Ross Date: Wed, 8 Oct 2025 08:30:50 +0200 X-Gm-Features: AS18NWBp_QDwMFXrBjSAZqAWaQEX0K0hrju4R-uN0iKw1C687fLK-sI92E-MroE Message-ID: Subject: SQL query latency when using pgPool (v4.6.2) To: pgpool-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000fbffdd06409fd3d8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000fbffdd06409fd3d8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, I am currently testing SQL query performance using PgPool (v4.6.2) as a load balancer, and I am observing approximately 18=E2=80=9320 ms latency be= tween SQL statements within the same transaction. Execution time on the PostgreSQL backend servers is less than 0.5 ms. It=E2=80=99s important to note that both the application and database serve= rs 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 =E2=80=9CExecute=E2=80=9D and =E2=80=9CParse=E2=80=9D phases. When connecti= ng 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 = =E2=80=94 for some queries this reduced inter-query latency to 2=E2=80=933 ms, but fo= r others it increased to 30=E2=80=9340 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 --000000000000fbffdd06409fd3d8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hello,

I am currently testing SQL query performance using PgPool (v4.6.2) as a = load balancer, and I am observing approximately 18=E2=80=9320 ms latency be= tween SQL statements within the same transaction. Execution time on the Pos= tgreSQL backend servers is less than 0.5 ms.

It=E2=80=99s important to note that both the application and database se= rvers 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 bo= th application and pgPool logs. The delay consistently occurs between the = =E2=80=9CExecute=E2=80=9D and =E2=80=9CParse=E2=80=9D phases. When connecti= ng directly to the PostgreSQL backends, the same transaction completes in a= bout 10 ms, with roughly 1 ms between SQL statements.

We have tested the following configurations:
- Switched from the <= /b>extended query protocol to the simple query protocol =E2=80=94 fo= r some queries this reduced inter-query latency to 2=E2=80=933 ms, but for = others it increased to 30=E2=80=9340 ms due to additional parsing overhead.=
- Adjusted various PgPool parameters related to load balancing and conn= ection pooling (e.g., load_balance_mode, statement_level_load_balance, seri= alize_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 o= r tuning approaches that could help improve throughput and reduce latency i= n extended query protocol?=C2=A0

Thank you,
Bob

--000000000000fbffdd06409fd3d8--