Re: what does pg_activity mean when the database is stuck?

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Si Chen <sichen(at)opensourcestrategies(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: what does pg_activity mean when the database is stuck?
Date: 2014-06-11 16:29:53
Message-ID: CAMkU=1xysMXbikapfSprH_m=RFKp+sRcYwAeA9s2D5kZm7C86w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jun 11, 2014 at 8:59 AM, Si Chen <sichen(at)opensourcestrategies(dot)com>
wrote:

> I have a problem where postgresql 9.3 got stuck, and the number of
> postgresql processes increased from about 15 to 225 in 10 minutes.
>
> I ran the query:
> select pid, query_start, waiting, state, query from pg_stat_activity order
> by query_start;
>
> But it showed mostly select statements -- all of them the same one, with a
> couple of joins. They are not in a waiting state but have been running for
> over 2 hours.
>
> I also checked for locks with the query on
> http://wiki.postgresql.org/wiki/Lock_Monitoring
>
> But it returned no locked tables.
>
> So what does this mean? Is the select query getting stuck?
>

Do you have a huge chunk of newly insert, not yet committed, rows? This
sounds like the issue where all of the processes fight with each other over
the right to check uncommitted rows in order to verify that they are
actually uncommitted.

Cheers,

Jeff

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2014-06-11 17:55:37 Re: Cannot start Postgresql 9.3 as a service in Windows 2012 Server with a domain account
Previous Message boca2608 2014-06-11 16:05:06 Cannot start Postgresql 9.3 as a service in Windows 2012 Server with a domain account