| From: | "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com> |
|---|---|
| To: | John R Pierce <pierce(at)hogranch(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: <IDLE> connections and cpu consumption |
| Date: | 2011-11-09 19:35:50 |
| Message-ID: | 482E80323A35A54498B8B70FF2B8798004D5DE156C@azsmsx504.amr.corp.intel.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Ahhhh... so if the script that has the connection open would only terminate the transaction, then vacuum wouldn't get behind?
I actually made a change in that script to rollback when the script doesn't need the changes in the transaction, hopefully allowing vacuum to do its thing.
Thanks!
-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of John R Pierce
Sent: Wednesday, November 09, 2011 2:21 PM
To: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] <IDLE> connections and cpu consumption
On 11/09/11 10:35 AM, Gauthier, Dave wrote:
>
> 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".
>
perhaps you just happened to sample pg_stat_activity in between queries?
<IDLE> should be just that. <IDLE> in transaction is equally idle, but
there's an open transaction. if these processes STAY idle in
transaction for too long they can cause vacuum to get behind, thats
typically hours-to-days before this is a problem in most scenarios.
--
john r pierce N 37, W 122
santa cruz ca mid-left coast
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Cody Caughlan | 2011-11-09 19:48:58 | Insufficient privilege when initiating backup |
| Previous Message | Magnus Hagander | 2011-11-09 19:24:35 | Re: <IDLE> connections and cpu consumption |