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-23 23:14:31
Message-ID: 67613.1637709271@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:
> If I measure from `ps -ef | grep postgres` and look at the connections
> then I can see that with the startup connections I am hitting this limit.
> So client processes which are listed to the OS as "startup" ARE counted
> towards the 597 connections, but are NOT reported in pg_stat_activity

So I guess the question becomes why are they spending so much time in
the startup state. That should take mere milliseconds, unless the
clients are being slow to handle the authentication exchange?

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.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message James Sewell 2021-11-23 23:48:12 Re: Max connections reached without max connections reached
Previous Message Adrian Klaver 2021-11-23 23:12:18 Re: Max connections reached without max connections reached