Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8707737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:56:41+00:00 2026-06-13T03:56:41+00:00

We recently upgraded to postgresql 9.1.6 (from 8.3). Our test server indicated that the

  • 0

We recently upgraded to postgresql 9.1.6 (from 8.3). Our test server indicated that the max_pred_locks_per_transaction should be set at least as high as 900 (which is way beyond the recommended setting of 64).

We’re now in production, and I’ve had to increase this parameter many times, as our log will start filling with:

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

With a client connection setting of 600 (but a pooling system that never goes over 100 clients):

max_pred_locks_per_transaction:
We went to 3000. Ran out in about a day.
Went to 9000, ran out in about 3 days.

I now have it set to 30000, and since this number is the average allocated per allowed client connection, I now have around 5 GB of shared memory dedicated to lock space!

I do have shared_buffers set rather high (24GB at the moment), which is over the 40% RAM figure. (I plan to tune this down to about 25% of RAM at the next restart).

EDIT: This tuning turned out to be a bad idea. My database is it with a lot of heavy queries, and having half of a large RAM dedicated to shared_buffers keeps it from choking, as it can cache the larger tables completely.

On average, I see somewhere around 5-10 active queries at a time. Our query load far outstrips our update load.

Anybody care to tell me how I might track down what is going wrong here? With such a small update set, I really can’t figure out why we are running out of locks so often…it really does smell like a leak to me.

Anyone know how to examine where the locks are going? (e.g. how might I read the content of pg_locks with respect to this issue)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T03:56:42+00:00Added an answer on June 13, 2026 at 3:56 am

    This sounds like it is likely to be caused by a long-running transaction. Predicate locks for one transaction cannot be released until all overlapping read-write transactions complete. This includes prepared transactions.

    Take a look at both pg_stat_activity and pg_prepared_xacts for any transactions which started (or were prepared) more than a few minutes ago.

    The only other probable, non-bug explanation I can think of is that you have tables with hundreds or thousands of partitions.

    If neither of these explanations makes sense, I would love to get my hands on a reproducible test case. Is there any way to create tables, populate them with queries using generate_series() and make this happen in a predictable way? With such a test case I can definitely track down the cause.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently upgraded a web server from IIS6 to IIS7 for a classic asp
We recently upgraded our rails app from version 3.0.3 to 3.1.0. The application runs
We recently upgraded a server from PHP4 to PHP5.4 There is an application running
I recently upgraded our project's jQuery file from 1.4.2 to 1.4.4 and it appears
I recently upgraded my server running CentOS 5.0 to a quad-core CPU from a
I recently upgraded my Mac's OS from Lion to Lion Server, which changes how
I recently upgraded from 4.0.1 to 4.2.1 and noticed that when I publish to
I recently upgraded from jQuery 1.2.6 to 1.3.2 Now on the page I'm using
I recently upgraded my machine from Leopard to Snow Leopard. Also I installed the
I recently upgraded to eclipse indigo from galileo. There has been some changes in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.