pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Change default of max_locks_per_transactions to 128
Date: Fri, 03 Apr 2026 17:32:04 +0000
Message-ID: <E1w8iNH-002maX-1C@gemulon.postgresql.org> (raw)

Change default of max_locks_per_transactions to 128

The previous commits reduced the amount of memory available for locks
by eliminating the "safety margins" and by settling the split between
LOCK and PROCLOCK tables at startup. The allocation is now more
deterministic, but it also means that you often hit one of the limits
sooner than before. To compensate for that, bump up
max_locks_per_transactions from 64 to 128. With that there is a little
more space in the both hash tables than what was the effective maximum
size for either table before the previous commits.

This only changes the default, so if you had changed
max_locks_per_transactions in postgresql.conf, you will still have
fewer locks available than before for the same setting value. This
should be noted in the release notes. A good rule of thumb is that if
you double max_locks_per_transactions, you should be able to get as
many locks as before.

Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Matthias van de Meent <boekewurm+postgres@gmail.com>
Discussion: https://www.postgresql.org/message-id/e07be2ba-856b-4ff5-8313-8b58b6b4e4d0@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/79534f90657c37c5238e5341a111dedd26d9c0fb

Modified Files
--------------
doc/src/sgml/config.sgml                      | 2 +-
src/backend/utils/init/postinit.c             | 2 +-
src/backend/utils/misc/guc_parameters.dat     | 2 +-
src/backend/utils/misc/postgresql.conf.sample | 2 +-
src/bin/pg_resetwal/pg_resetwal.c             | 4 ++--
5 files changed, 6 insertions(+), 6 deletions(-)



Message-ID: <E1w8iNH-002maX-1C@gemulon.postgresql.org>
Permalink:  ../E1w8iNH-002maX-1C@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w8iNH-002maX-1C@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: heikki.linnakangas@iki.fi, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Change default of max_locks_per_transactions to 128
  In-Reply-To: <E1w8iNH-002maX-1C@gemulon.postgresql.org>

* 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