Re: Guideline To Resolve LWLock:SubtransControlLock

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Fred Habash <fmhabash(at)gmail(dot)com>
Cc: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Guideline To Resolve LWLock:SubtransControlLock
Date: 2018-08-16 18:36:32
Message-ID: 20180816183632.lo34je5dudbros4a@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 2018-Aug-16, Fred Habash wrote:

> One of our database API's is run concurrently by near 40 sessions. We see
> all of them waiting back and forth on this wait state.

What version are you running?

> Why is it called Subtrans Control Lock?

It controls access to the pg_subtrans structure, which is used to record
parent/child transaction relationships (as you say, savepoints and
EXCEPTIONs in plpgsql are the most common uses, but not the only ones).
Normally lookup of these is optimized away, but once you cross a
threshold it cannot any longer.

> What are the common user session scenarios causing this wait?
> - I have read some describe the use of SQL savepoints or PL/pgSQL
> exception handling.
> What are known resolution measures?

Are you in a position to recompile Postgres?

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Alexis Lê-Quôc 2018-08-17 13:21:19 Re: Bi-modal streaming replication throughput
Previous Message Fred Habash 2018-08-16 18:19:11 Guideline To Resolve LWLock:SubtransControlLock