From: Thomas Kellerer <shammat@gmx.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: Monitoring for long running transactions
Date: Thu, 4 Jun 2020 22:36:21 +0200
Message-ID: <4c717cc5-ac33-fd9a-a928-e78a46b63f69@gmx.net> (raw)
In-Reply-To: <920bb4ce-6ba8-2888-6239-52a15474fc58@net153.net>
References: <d2f5ded1-7820-e25f-2477-403283fbb2d0@net153.net>
<d2b17c01-bde0-7860-80d0-753d5c99a602@aklaver.com>
<920bb4ce-6ba8-2888-6239-52a15474fc58@net153.net>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: shammat@gmx.net
Subject: Re: Monitoring for long running transactions
In-Reply-To: <4c717cc5-ac33-fd9a-a928-e78a46b63f69@gmx.net>
References: <d2f5ded1-7820-e25f-2477-403283fbb2d0@net153.net> <d2b17c01-bde0-7860-80d0-753d5c99a602@aklaver.com> <920bb4ce-6ba8-2888-6239-52a15474fc58@net153.net> <4c717cc5-ac33-fd9a-a928-e78a46b63f69@gmx.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox