Обсуждение: Usage up to 50% CPU

Список
Период
Сортировка

Usage up to 50% CPU

От
"Andres Retzlaff"
Дата:
Hi,

I have pg 8.1.4 running in
Windows XP Pro
wirh a Pentium D

and I notice that I can not use more than 50% of the cpus (Pentium D has 2
cpus), how can I change the settings to use the 100% of it.

Regards,
Andrew Retzlaff

_________________________________________________________________
Advertisement: Visit LetsShop.com to WIN Fabulous Books Weekly

http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fwww%2Eletsshop%2Ecom%2FLetsShopBookClub%2Ftabid%2F866%2FDefault%2Easpx&_t=751480117&_r=HM_Tagline_books&_m=EXT


Re: Usage up to 50% CPU

От
Magnus Hagander
Дата:
On Fri, Apr 27, 2007 at 04:43:06AM +0000, Andres Retzlaff wrote:
> Hi,
>
> I have pg 8.1.4 running in
> Windows XP Pro
> wirh a Pentium D
>
> and I notice that I can not use more than 50% of the cpus (Pentium D has 2
> cpus), how can I change the settings to use the 100% of it.

A single query will only use one CPU. If you have multiple parallell
clients, they will use the differnt CPUs.

//Magnus


Re: Usage up to 50% CPU

От
"Andres Retzlaff"
Дата:
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?

Andrew

On Fri, Apr 27, 2007 at 04:43:06AM +0000, Andres Retzlaff wrote:
 > Hi,
 >
 > I have pg 8.1.4 running in
 > Windows XP Pro
 > wirh a Pentium D
 >
 > and I notice that I can not use more than 50% of the cpus (Pentium D has
2
 > cpus), how can I change the settings to use the 100% of it.

A single query will only use one CPU. If you have multiple parallell
clients, they will use the differnt CPUs.

//Magnus

_________________________________________________________________
Advertisement: Its simple! Sell your car for just $30 at carsales.com.au

http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801577%2Fpi%5F1005244%2Fai%5F838588&_t=754951090&_r=tig&_m=EXT


Re: Usage up to 50% CPU

От
Magnus Hagander
Дата:
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


Re: Usage up to 50% CPU

От
Shane Ambler
Дата:
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


Get Sheeky @ http://Sheeky.Biz

Re: Usage up to 50% CPU

От
Michael Stone
Дата:
On Fri, Apr 27, 2007 at 07:23:41PM +0930, Shane Ambler wrote:
>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?

If so, you probably wouldn't be seeing that much cpu usage... (if the
cpu is waiting for disk it's idling)

Mike Stone

Re: Usage up to 50% CPU

От
"Andres Retzlaff"
Дата:
>On Fri, Apr 27, 2007 at 07:23:41PM +0930, Shane Ambler wrote:
>>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?

>If so, you probably wouldn't be seeing that much cpu usage... (if the cpu
>is waiting for disk it's >idling)

>Mike Stone

Yes, I notice 3 steeps:
1) the CPU is at 100% (of 1 cpu)
2) the HDD is 100% but no much of the cpu
3) I get the query display

I will see what can I do to improved the speed. At this moment is taking 10
sec to get the responce.

Regards,
Andrew Retzlaff

_________________________________________________________________
Advertisement: Its simple! Sell your car for just $30 at carsales.com.au

http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801577%2Fpi%5F1005244%2Fai%5F838588&_t=754951090&_r=tig&_m=EXT