Re: Max connections reached without max connections reached

Поиск
Список
Период
Сортировка
От James Sewell
Тема Re: Max connections reached without max connections reached
Дата
Msg-id CAANVwEsT8WLVTdpifGbFBW5JVfX1873LJADjuLnUVDrrqmhvEQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Max connections reached without max connections reached  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
> Sorry, I could have been clearer - pg_stat_activity is what I'm looking
> at - I'm recording connection info from here every 15 seconds (from a
> superuser account so I don't get locked out). It never peaks above 300
> (in fact when the incident happens no new connections can come in so it
> falls to around 100) - yet I'm seeing the log lines claim that I'm still
> hitting 597 (600 - 3 reserved).

What is the query you are using against pg_stat_activity?


For general counts ad-hoc we just use:

SELECT count(*) FROM pg_stat_activity

The monitoring system runs:

SELECT CASE WHEN usename IS NOT NULL THEN usename ELSE 'SYSTEM' END as role, 
        datname AS database,
        state,
        wait_event,
        count(*) AS connection
FROM pg_stat_activity
GROUP BY 1,2,3,4

 


The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Max connections reached without max connections reached
Следующее
От: James Sewell
Дата:
Сообщение: Re: Max connections reached without max connections reached