Uploaded image for project: 'Configuration Persistence Service'
  1. Configuration Persistence Service
  2. CPS-1533

Temp tables cause "Out of shared memory" errors in Postgres

XMLWordPrintable

      The DB sometimes reports being out of shared memory. This is a FATAL database error that will cause REST requests to fail. It can be seen after registering 20,000 CM handles in NCMP. This error is caused by temp tables existing for the duration of the session, by default. The behavior can be changed to drop the tables when the transaction finishes.

      Excerpt from postgres log:

      [176] FATAL:  out of shared memory
      [176] HINT:  You might need to increase max_locks_per_transaction.
      [72] FATAL:  out of shared memory
      [72] HINT:  You might need to increase max_locks_per_transaction.
      

      After waiting a few minutes, the DB auto-vacuum process will run, which frees temp tables:

      [262] LOG:  autovacuum: dropping orphan temp table "cpsdb.pg_temp_12.xpathtemporarytablec58fa2bb6b6e4df781ef281fbbc1d3e0"
      [262] LOG:  autovacuum: dropping orphan temp table "cpsdb.pg_temp_12.modulereferencestochecktemp62679735ec194c458a4eef319639e589"
      

      (A complete log shows hundreds of open temp tables after registering 20k CM handles.)

            danielhanrahan Daniel Hanrahan
            danielhanrahan Daniel Hanrahan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: