WALWriteLocks

From: Don Seiler <don(at)seiler(dot)us>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: WALWriteLocks
Date: 2021-04-28 18:53:39
Message-ID: CAHJZqBDXNEOZDYQXB+xUK2ie-Tjzmn72RHVec-NsCNyU4TeydQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Good afternoon,

We're running a few PostgreSQL 12 instances in VMs in the MS Azure cloud.
We have one instance in particular that will seemingly lock up for a few
seconds (and on rare occasions a few minutes). When looking at the metrics,
it looks like most of the active sessions all begin waiting on
WALWriteLocks. Shortly after we'll see a flurry of COMMITs in the PG log.
For example, we would observe 75-90 sessions all waiting on WALWriteLock
for 30 seconds and then suddenly they would all write the COMMIT action to
the PG log (showing the ~30 second duration). When this wait goes on for
minutes, then it is definitely noticed by the app and users.

We have moved the WAL files to separate Azure UltraSSD storage and are
working with Azure support to try to identify the bottleneck here.

My understanding is that the WALWriteLock is solely due to the session's
commit waiting to write to the WAL file, so our focus has been on the
storage under the WAL files. I'm curious if there are any other events
inside PostgreSQL that would be behind the WALWriteLock, to make sure we
aren't chasing a red herring.

Thanks,
Don.

--
Don Seiler
www.seiler.us

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Laurenz Albe 2021-04-29 06:38:31 Re: WALWriteLocks
Previous Message Bruce Momjian 2021-04-26 16:58:01 Re: TDE in postgres