pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: MichaelDBA <MichaelDBA@sqlexec.com>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Ashkil Dighin <ashkildighin76@gmail.com>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: Lock contention high
Date: Wed, 13 Oct 2021 14:15:34 -0400
Message-ID: <0b264a08-b723-eec2-c667-49f17b0a487c@sqlexec.com> (raw)
In-Reply-To: <20211013164805.GC27491@telsasoft.com>
References: <CAH6zzqCNtbCDSSFweuZp93R7TOxfEB8f75iosExb6sutyAa-Uw@mail.gmail.com>
	<20211013164805.GC27491@telsasoft.com>

> 1.Is there a way to tune the lock contention ?
> 2.Is any recommendations to tune/reduce the lock contention via postgres.conf
I think you'd want to find *which* LW locks are being waited on, to see if it's
something that can be easily tuned.

You can check pg_stat_activity, or maybe create a cronjob to record its content
for later analysis.


Hello,

Also turn on log_lock_waits so you can evaluate the actual SQL causing 
the problems in the PG log files.  Thinking ahead, you may want to 
consider if using advisory locks from the application side of things 
might be helpful to manage locks in a more pessimistic way.  Also, join 
with pg_locks table to find out the specific resources that are in 
contention.

Regards,
Michael Vitale

view thread (26+ messages)  latest in thread

Message-ID: <0b264a08-b723-eec2-c667-49f17b0a487c@sqlexec.com>
Permalink:  ../0b264a08-b723-eec2-c667-49f17b0a487c@sqlexec.com/
Also on:    postgresql.org/message-id/0b264a08-b723-eec2-c667-49f17b0a487c@sqlexec.com

 · 

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: pgsql-performance@postgresql.org
  Cc: MichaelDBA@sqlexec.com, pryzby@telsasoft.com, ashkildighin76@gmail.com, pgsql-performance@lists.postgresql.org
  Subject: Re: Lock contention high
  In-Reply-To: <0b264a08-b723-eec2-c667-49f17b0a487c@sqlexec.com>

* 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