Re: Monitoring for long running transactions

From: Thomas Kellerer <shammat(at)gmx(dot)net>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Monitoring for long running transactions
Date: 2020-06-04 20:36:21
Message-ID: 4c717cc5-ac33-fd9a-a928-e78a46b63f69@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Samuel Smith schrieb am 04.06.2020 um 21:59:
> Sorry, I should have clarified that I was aware of the
> pg_stat_activity table. That is how we found the problem in the first
> place. And yes I could just write a bash script and run it in cron. I
> just didn't know if there was a more "official" way to go about this
> since it is probably a common monitoring point and/or if something
> like this was already made.

What about setting idle_in_transaction_session_timeout to some reasonably high value (15 minutes?)

Then you would get an error in your application because the connection was terminated and you would learn early about the problem.
Even with monitoring enabled, you would probably still kill those sessions manually as the application most probably can't commit them properly any more.

Thomas

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2020-06-04 22:05:56 Re: Move configuration files with pg_upgrade
Previous Message Christoph Moench-Tegeder 2020-06-04 20:29:11 Re: Monitoring for long running transactions