Re: Commit Latency

From: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Ramakrishna m <ram(dot)pgdb(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org, ravisql09(at)gmail(dot)com
Subject: Re: Commit Latency
Date: 2025-02-05 15:37:50
Message-ID: 202502051537.rpohgrxu4vrz@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

On 2025-Feb-05, Ramakrishna m wrote:

> I have a system handling *300 TPS*, with resource usage *below 10%*.
> However, I’m noticing *commit latency of around 200ms* for *1% of
> transactions*, occasionally spiking to *1 second*. Since there is no
> significant *I/O pressure*, I’m trying to identify what else might be
> causing this in *PostgreSQL 16*.

max_connections=8000 doesn't sound great -- how many of those are
active, typically, and how many are idle-in-transaction? And you have
autovacuum_naptime=5s ... which sounds rather dubious. Either somebody
with great expertise configured this very carefully, or the settings are
somewhat randomly chosen with little or no expert oversight. Do you
have monitoring on the amount of bloat on these database? Maybe you
should consider connection pooling and limit the number that are active,
for starters.

Maybe have a look at whether pg_wait_sampling can give you more clues.
Some basic bloat monitoring is a prerequisite to any further performance
tweaking anyhow.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
Maybe there's lots of data loss but the records of data loss are also lost.
(Lincoln Yeoh)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2025-02-05 16:15:14 Re: Table copy
Previous Message Andy Hartman 2025-02-05 13:40:00 Re: Table copy