Re: Handling idle connections

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Handling idle connections
Дата
Msg-id 69504.1695612894@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Handling idle connections  (Rajesh Kumar <rajeshkumar.dba09@gmail.com>)
Список pgsql-admin
Rajesh Kumar <rajeshkumar.dba09@gmail.com> writes:
> 1. I see lot of idle connections where application_name is blank and also
> query is blank, i am identifying only with user. In this case how do I
> identify which application is using idle connection?

If pg_stat_activity.query is empty, then that is a connection that has
*never* issued a query (because once it has, the query column reflects
the last query even when the session is idle).  So apparently you have
a rather broken application that connects and then does nothing.

I'd suggest fixing the client side so that it sets application_name to
something that would help identify the situation.  If the client is
libpq-based, you might be able to do this by setting the PGAPPNAME
environment variable in an invoking script, rather than modifying
any low-level code.

            regards, tom lane



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

Предыдущее
От: Rui DeSousa
Дата:
Сообщение: Re: Handling idle connections
Следующее
От: mu88
Дата:
Сообщение: Seed pgAdmin roles with Active Directory groups when using Docker