pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shane Ambler <pgsql@Sheeky.Biz>
To: Magnus Hagander <magnus@hagander.net>
Cc: Andres Retzlaff <andres_retzlaff@hotmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Usage up to 50% CPU
Date: Fri, 27 Apr 2007 19:23:41 +0930
Message-ID: <4631C825.9000705@Sheeky.Biz> (raw)
In-Reply-To: <20070427081350.GD12895@svr2.hagander.net>
References: <20070427080653.GB12895@svr2.hagander.net>
	<BAY141-F1845ACAADC609F4311EA888B4F0@phx.gbl>
	<20070427081350.GD12895@svr2.hagander.net>

Magnus Hagander wrote:
> On Fri, Apr 27, 2007 at 08:10:48AM +0000, Andres Retzlaff wrote:
>> Hi Magnus,
>>
>> in this case each CPU goes up to 50%, giveing me 50% total usage. I was 
>> specting as you say 1 query 100% cpu.
>>
>> Any ideas?
> 
> No. 1 query will only use 100% of *one* CPU, which means 50% total usage.
> You need at least one query per CPU to reach full 100% of the whole system.
> (Actually, you can get slightly above 50% since the query will run on one
> CPU and the OS and autovacuum and bgwriter can run on the other. But it's
> marginally)
> 
> //Magnus

I would think that as you are sitting and watching the cpu usage, your 
query would seem to taking a while to run, leading me to wonder if you 
are getting a full table scan that is causing pg to wait for disk response?

Or are you running a long list of steps that take a while?



-- 

Shane Ambler
pgSQL@Sheeky.Biz

Get Sheeky @ http://Sheeky.Biz



view thread (7+ messages)  latest in thread

Message-ID: <4631C825.9000705@Sheeky.Biz>
Permalink:  ../4631C825.9000705@Sheeky.Biz/
Also on:    postgresql.org/message-id/4631C825.9000705@Sheeky.Biz

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: pgsql@Sheeky.Biz, magnus@hagander.net, andres_retzlaff@hotmail.com
  Subject: Re: Usage up to 50% CPU
  In-Reply-To: <4631C825.9000705@Sheeky.Biz>

* 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