Re: WALWriteLocks - Mailing list pgsql-admin

From Laurenz Albe
Subject Re: WALWriteLocks
Date
Msg-id 38d3ba77341d35afbee921cf8dbce4fe70951763.camel@cybertec.at
Whole thread Raw
In response to Re: WALWriteLocks  (Don Seiler <don@seiler.us>)
List pgsql-admin
On Thu, 2021-04-29 at 11:11 -0500, Don Seiler wrote:
> On Thu, Apr 29, 2021 at 1:38 AM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
> > My gues is that you have too many active client connections, and you are suffering
> > from contention between the many backends that all want to write WAL.
> > 
> > In that case, use a connection pool to limit the number of active connections.
> 
> We do have pgbouncer in place already.

What is the maximum pool size?
How many connections in state "active" do you have?

> What I really want to know in this case is if there is some other PG operation that
>  accounts for a WALWriteLock wait, or is it always an I/O (write) to the WAL file
>  storage, and we can focus our investigation there? 

WALWriteLock: must be held to write WAL buffers to disk (XLogWrite or XLogFlush).

It might be I/O overload, but it could also be internal contention for the lock.
Check the "%iowait" column in "sar -u 1".

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




pgsql-admin by date:

Previous
From: Vijaykumar Jain
Date:
Subject: Re: WALWriteLocks
Next
From: Laurenz Albe
Date:
Subject: Re: WALWriteLocks