public inbox for [email protected]  
help / color / mirror / Atom feed
From: Vivek Gadge <[email protected]>
To: [email protected]
Subject: Guidance on Calculating max_locks_per_transaction for a Highly Partitioned Environment
Date: Mon, 29 Jun 2026 23:25:59 +0530
Message-ID: <CAK+uD7g=EE4ypAsuF8L9ZQ3FSuRD-YJ8nOkkyDnSooA_jidycQ@mail.gmail.com> (raw)

Hello Team,

I am looking for guidance on determining an appropriate value for the
max_locks_per_transaction parameter in our PostgreSQL 17.6 production
environment.

Environment has the following characteristics:

    PostgreSQL Version: 17.6
    max_connections = 1500
    Daily partitioning strategy
    Large OLTP workload with transactions that may access multiple
partitions

Occasionally, we encounter the following error:

ERROR: out of shared memory
HINT: You might need to increase max_locks_per_transaction.

We understand that the shared lock table is sized based on
max_locks_per_transaction, max_connections, and max_prepared_transactions.
However, we have not found any guidance on how to estimate an appropriate
value for environments with a large number of partitions and indexes.

We would appreciate guidance on the following:

    Is there a recommended methodology or formula for estimating
max_locks_per_transaction.

Our objective is to determine an appropriate value based on workload
characteristics rather than increasing the parameter through trial and
error.

Thanks

Vivek Gadge.


view thread (2+ 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]
  Subject: Re: Guidance on Calculating max_locks_per_transaction for a Highly Partitioned Environment
  In-Reply-To: <CAK+uD7g=EE4ypAsuF8L9ZQ3FSuRD-YJ8nOkkyDnSooA_jidycQ@mail.gmail.com>

* 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