public inbox for [email protected]  
help / color / mirror / Atom feed
From: Laurenz Albe <[email protected]>
To: James Pang <[email protected]>
To: [email protected]
Subject: Re: lwlock:LockManager wait_events
Date: Fri, 25 Oct 2024 10:36:45 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAHgTRfesRFm1BuG_5guvdSCof2qoHGZvaa1YEkim97EMALaWgQ@mail.gmail.com>
References: <CAHgTRfesRFm1BuG_5guvdSCof2qoHGZvaa1YEkim97EMALaWgQ@mail.gmail.com>

On Fri, 2024-10-25 at 14:36 +0800, James Pang wrote:
> we faced into a lot of  lwlock:LockManager wait-events , all of these queries are "select ..." ,
> there are other several session are doing DML, insert/update/delete on same table.
> Did these DML transactions holding "transactionid" and "tuple" lock blocking "select" on lwlock:LockManager ?

This is not about waiting for a lock.  Rather, it means that very many sessions are trying
to take a lock.  They have to grab the lock manager to take a lock, and the competition for
that resource is the bottleneck.

It is hard to say what is the root cause without further analysis, but very often the
cause is that you have too many connections to the database.  Using an effective connection
pool *might* solve that particular problem.

Yours,
Laurenz Albe





view thread (5+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: lwlock:LockManager wait_events
  In-Reply-To: <[email protected]>

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

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