Comment on max_locks_per_transaction

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-docs(at)postgreSQL(dot)org
Subject: Comment on max_locks_per_transaction
Date: 2012-06-15 18:05:30
Message-ID: 4FDB796A.7080803@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Folks,

Way it is now:

===============

max_locks_per_transaction (integer)

The shared lock table tracks locks on max_locks_per_transaction *
(max_connections + max_prepared_transactions) objects (e.g., tables);
hence, no more than this many distinct objects can be locked at any one
time. This parameter controls the average number of object locks
allocated for each transaction; individual transactions can lock more
objects as long as the locks of all transactions fit in the lock table.
This is not the number of rows that can be locked; that value is
unlimited. The default, 64, has historically proven sufficient, but you
might need to raise this value if you have clients that touch many
different tables in a single transaction. This parameter can only be set
at server start.

Increasing this parameter might cause PostgreSQL to request more
System V shared memory than your operating system's default
configuration allows. See Section 17.4.1 for information on how to
adjust those parameters, if necessary.

When running a standby server, you must set this parameter to the
same or higher value than on the master server. Otherwise, queries will
not be allowed in the standby server.

================

The way it should be:

max_locks_per_transaction (integer)

The shared lock table tracks locks on max_locks_per_transaction *
(max_connections + max_prepared_transactions) objects (e.g., tables);
hence, no more than this many distinct objects can be locked at any one
time. This parameter controls the average number of object locks
allocated for each transaction; individual transactions can lock more
objects as long as the locks of all transactions fit in the lock table.
This is not the number of rows that can be locked; that value is
unlimited. This parameter can only be set at server start.

The default, 64, has historically proven sufficient for most databases,
but you might need to raise this value if you have clients that touch
many different tables in a single transaction. Databases with several
tables with many partitions each can require raising this setting. The
PostgreSQL activity log will contain a fairly clear error message
suggesting raising max_locks_per_transaction if needed.

Increasing this parameter might cause PostgreSQL to request more
System V shared memory than your operating system's default
configuration allows. See Section 17.4.1 for information on how to
adjust those parameters, if necessary.

When running a standby server, you must set this parameter to the
same or higher value than on the master server. Otherwise, queries will
not be allowed in the standby server.

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Jeff Davis 2012-06-15 19:25:14 Re: Comment on max_locks_per_transaction
Previous Message Magnus Hagander 2012-06-03 15:31:30 Re: Starting server on OpenBSD, IE7 fix for forms