Re: Max connections reached without max connections reached

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: James Sewell <james(dot)sewell(at)jirotech(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Max connections reached without max connections reached
Date: 2021-11-24 02:24:28
Message-ID: 81460.1637720668@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

James Sewell <james(dot)sewell(at)jirotech(dot)com> writes:
>> I'm also wondering a bit about whether they're being blocked on a lock,
>> eg. due to something taking an exclusive lock on pg_authid or pg_database.
>> pg_locks might be interesting to check.

> postgres=# select * from pg_locks where not granted;

The hypothesis I'm thinking of is that incoming sessions are being blocked
somewhere before they can acquire a ProcArray entry; if so, they'd not
show up in either pg_stat_activity or pg_locks. What we have to look for
then is evidence of somebody holding a strong lock on a shared relation.
Try "select * from pg_locks where locktype = 'relation' and database = 0".

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Luca Ferrari 2021-11-24 13:53:24 get last timestamp of table ddl
Previous Message James Sewell 2021-11-24 01:51:28 Re: Max connections reached without max connections reached