From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: James Sewell <james.sewell@jirotech.com>
To: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Max locks
Date: Thu, 19 Dec 2019 13:02:44 +0100
Message-ID: <ae27bd07-a93f-9274-849a-12dc35228745@2ndquadrant.com> (raw)
In-Reply-To: <CAANVwEvRv0ZKiZvVeFJu=_d2XzBwv+MhidzvUWF6L6+of_DBhw@mail.gmail.com>
References: <CAANVwEvRv0ZKiZvVeFJu=_d2XzBwv+MhidzvUWF6L6+of_DBhw@mail.gmail.com>
On 2019-12-19 10:33, James Sewell wrote:
> I have a system which is giving me the log hint to increase
> max_locks_per_transaction. This is somewhat expected due to the workload
> - but what I can't understand is the numbers:
>
> Based on the docs I calculate my theoretical max locks as:
>
> max_locks_per_transaction * (max_connections + max_prepared_transactions)
> 256 * (600 + 0) = *153600*
>
> However, looking at my Prometheus monitoring (polling every 15s) which
> does a SELECT from pg_locks and groups by mode I can see there are over
> 500K AccessShareLocks consistently (up to around 570K at peak).
max_locks_per_transactions only affects relation locks (also known as
heavy weight locks), but pg_locks also shows other kinds of locks.
Filter by locktype = 'relation' to get the appropriate view.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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: peter.eisentraut@2ndquadrant.com, james.sewell@jirotech.com
Subject: Re: Max locks
In-Reply-To: <ae27bd07-a93f-9274-849a-12dc35228745@2ndquadrant.com>
References: <CAANVwEvRv0ZKiZvVeFJu=_d2XzBwv+MhidzvUWF6L6+of_DBhw@mail.gmail.com> <ae27bd07-a93f-9274-849a-12dc35228745@2ndquadrant.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