pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ben Hoskings <ben@hoskings.net>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Occasional lengthy locking causing stalling on commit
Date: Sat, 30 Jan 2021 11:50:14 -0500
Message-ID: <2884110.1612025414@sss.pgh.pa.us> (raw)
In-Reply-To: <CACTv1AL=6QNxku8riJ8VS0xFFnK2wNETy-H4tz+WUE=vBcUPsw@mail.gmail.com>
References: <CACTv1AL=6QNxku8riJ8VS0xFFnK2wNETy-H4tz+WUE=vBcUPsw@mail.gmail.com>

Ben Hoskings <ben@hoskings.net> writes:
> We have a postgres 11.9 instance serving 7-8k queries/sec. In general
> it's humming along with no issues (p50 patency of ~1ms; p95 ~30ms).
> Lately though, we've seen occasional locking that causes all commits
> to the main database to be briefly blocked and the APIs that it backs
> to stall.
> ...
>   * We make heavy use of listen/notify via que with ~80 notify events
> per second across 16 listen channels. (https://github.com/que-rb/que)

Possibly you'd benefit from updating to v13, which has the listen/notify
performance improvements Martijn referred to in the other thread.

It's also possible that the hangup is unrelated to that, being somewhere
later in commit processing than where the notify traffic gets dumped out.
If you could identify which process has the "database 0" lock during one
of these delays, and capture a stack trace from it, that would be
super-informative.  Not sure about a good way to do that though.
Maybe you could automate tailing the log for "DETAIL: Process holding the
lock: nnn." and gdb'ing that process.

			regards, tom lane





view thread (5+ messages)  latest in thread

Message-ID: <2884110.1612025414@sss.pgh.pa.us>
Permalink:  ../2884110.1612025414@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2884110.1612025414@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ben@hoskings.net
  Subject: Re: Occasional lengthy locking causing stalling on commit
  In-Reply-To: <2884110.1612025414@sss.pgh.pa.us>
  References: <CACTv1AL=6QNxku8riJ8VS0xFFnK2wNETy-H4tz+WUE=vBcUPsw@mail.gmail.com> <2884110.1612025414@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox