Re: <IDLE> connections and cpu consumption

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: <IDLE> connections and cpu consumption
Date: 2011-11-09 19:24:35
Message-ID: CABUevEwY6irt7zHTqahCxyG3O2+wJZkf84jj59dwpkUgdN=__w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wednesday, November 9, 2011, Gauthier, Dave wrote:

> Hi:****
>
> ** **
>
> PG v4.8.3 on Linux****
>
> ** **
>
> I'm using "selcet procpid,current_query from pg_stat_activity" to monitor
> activity during times when "top" is showing many PG procs with very high
> cpu usage numbers (all cores at or above 90%). Some of these are procs
> that map to PG connections with current_query = <IDLE>.****
>
> ** **
>
> What scenarios could explain a process identified as IDLE consuming lots
> of CPU?****
>
> ** **
>
> More clues... In parallel with these was a user that was making a series
> of insert/delete/update commands that fire off triggers that generate more
> DML recursively. Some of the idles are "<IDLE> in transaction".
>

My guess would be something running lots and lots of really short queries.
top will give you an averate CPU usage over an interval, but
pg_stat_activity shows a snapshot. So probably the sessions were running
simple things, but just at the moment pg_stat_activity "hits", it wasn't
doing anything.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gauthier, Dave 2011-11-09 19:35:50 Re: <IDLE> connections and cpu consumption
Previous Message John R Pierce 2011-11-09 19:24:27 Re: DB Dump