Re: Old query lying around in pg_stat_activity for weeks

Поиск
Список
Период
Сортировка
От Julien Rouhaud
Тема Re: Old query lying around in pg_stat_activity for weeks
Дата
Msg-id 20210326112528.6uiso3o2fgk73rqg@nol
обсуждение исходный текст
Ответ на Old query lying around in pg_stat_activity for weeks  (Jacque Edmund <jacqueedmund@gmail.com>)
Ответы Re: Old query lying around in pg_stat_activity for weeks  (Laurenz Albe <laurenz.albe@cybertec.at>)
Список pgsql-admin
On Fri, Mar 26, 2021 at 07:16:42AM -0400, Jacque Edmund wrote:
> Was alerted to an old query lying around in the pg_stat_activity view  on a
> little used server recently.   It ha no values for wait_event_type or
> wait_event and had an idle state value.  The query_start value was about
> two weeks old.  Odd, but after verifying it had no pg_lock lookup, I
> canceled it.
> 
> Might there be an infrequent staleness of items that appear in the
> pg_stat_activity view that is just understood to be there from time to time?

If the state is "idle" it means it's only a connection doing nothing, it's not
really consuming any resources.  You also can't cancel it, since it isn't doing
anything, just close it.

The best thing to do if you don't have persistent connections or a connection
pooler is to check where the connection coming from and investigate what could
be the client/application responsible for leaking an idle connection.



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

Предыдущее
От: Jacque Edmund
Дата:
Сообщение: Old query lying around in pg_stat_activity for weeks
Следующее
От: Tim
Дата:
Сообщение: Re: Creating redwood datestyle in Postgres 12