Re: Monitoring for long running transactions - Mailing list pgsql-general

From Thomas Kellerer
Subject Re: Monitoring for long running transactions
Date
Msg-id 4c717cc5-ac33-fd9a-a928-e78a46b63f69@gmx.net
Whole thread Raw
In response to Re: Monitoring for long running transactions  (Samuel Smith <pgsql@net153.net>)
List 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
theproblem.
 
Even with monitoring enabled, you would probably still kill those sessions manually as the application most probably
can'tcommit them properly any more.
 

Thomas





pgsql-general by date:

Previous
From: Christoph Moench-Tegeder
Date:
Subject: Re: Monitoring for long running transactions
Next
From: "Peter J. Holzer"
Date:
Subject: Re: Move configuration files with pg_upgrade