Re: what does pg_activity mean when the database is stuck? - Mailing list pgsql-general

From Si Chen
Subject Re: what does pg_activity mean when the database is stuck?
Date
Msg-id CAAYSSjNyWezd2FnVfu1da8MXu0_S3iM+k4RgYwoCZ1VQP4N0jg@mail.gmail.com
Whole thread Raw
In response to Re: what does pg_activity mean when the database is stuck?  (Merlin Moncure <mmoncure@gmail.com>)
Responses Re: what does pg_activity mean when the database is stuck?
Re: what does pg_activity mean when the database is stuck?
Re: what does pg_activity mean when the database is stuck?
List pgsql-general
Is there a way to configure postgresql to automatically release connections that have been idle for a set amount of time?


On Wed, Jun 11, 2014 at 3:41 PM, Merlin Moncure <mmoncure@gmail.com> wrote:
On Wed, Jun 11, 2014 at 5:37 PM, Si Chen
<sichen@opensourcestrategies.com> wrote:
> The state is "idle".  I don't have the state_change, but I will try to
> collect it if it happens again.

If they are idle, then the problem is probably with your application
-- you're grabbing new connections and not closing them or reusing
them.  It's a very common problem.  The 'query' when idle represents
the last query run -- the database finished it and is sitting around.

merlin



--
Si Chen
Open Source Strategies, Inc.
sichen@opensourcestrategies.com
http://www.OpenSourceStrategies.com
LinkedIn: http://www.linkedin.com/in/opentaps
Twitter: http://twitter.com/opentaps

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Question about partial functional indexes and the query planner
Next
From: Khangelani Gama
Date:
Subject: Postgres 9.2.4 - rebuild PostgreSQL using --with-libxml