Re: lwlock:LockManager wait_events - Mailing list pgsql-performance

From Laurenz Albe
Subject Re: lwlock:LockManager wait_events
Date
Msg-id f6065e6cc468acb43df2f0f953ef23a17efffebb.camel@cybertec.at
Whole thread Raw
In response to lwlock:LockManager wait_events  (James Pang <jamespang886@gmail.com>)
Responses Re: lwlock:LockManager wait_events
List pgsql-performance
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



pgsql-performance by date:

Previous
From: James Pang
Date:
Subject: lwlock:LockManager wait_events
Next
From: James Pang
Date:
Subject: Re: proposal: schema variables