Skip site navigation (1) Skip section navigation (2)

Re: High CPU load on Postgres Server during Peak times!!!!

From: Andy Colson <andy(at)squeakycode(dot)net>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: High CPU load on Postgres Server during Peak times!!!!
Date: 2009-09-22 14:35:26
Message-ID: 4AB8E0AE.30508@squeakycode.net (view raw or flat)
Thread:
Lists: pgsql-performance
Andy Colson wrote:
> Shiva Raman wrote:
>> Dear all
>>
>>   I am having a problem of high cpu loads in my postgres server during 
>> peak time. Following are the
>> details of my setup (details as per the postgres wiki) .
>>
>>
>> *Following is the output of TOP command during offpeak time.*
>>
>>
>> top - 18:36:56 up 77 days, 20:33,  1 user,  load average: 12.99, 9.22, 
>> 10.37
>> Tasks: 142 total,  12 running, 130 sleeping,   0 stopped,   0 zombie
>> Cpu(s): 46.1%us,  1.9%sy,  0.0%ni,  6.1%id,  3.0%wa,  0.0%hi,  0.1%si, 
>> 42.9%st
>> Mem:  16133676k total, 13657396k used,  2476280k free,   450908k buffers
>> Swap: 14466492k total,      124k used, 14466368k free, 11590056k cached
>>
> 
> 
> First off, nice report.
> 
> I see you are on a pretty old version of pg.  Are you vacuuming regularly?
> 
> If you run a 'ps ax|grep post' do you see anything that says 'idle in 
> transaction'?  (I hope that old of version will show it.  my processes 
> show up as postgres not postmaster)
> 
> The top looks like you are cpu bound.  Have you tried enabling logging 
> slow queries? (again, I hope your version supports that)  It could be 
> you have a query or two that are not using indexes, and slowing 
> everything down.
> 
> Also on the top, it has this: 42.9%st.  Are you in a vm?  or running 
> vm's on the box?
> 
> Its weird, you have 6.1% idle and 3.0% waiting for disk and yet you have 
> a load of 13.  Load usually means somebody is waiting for something. But 
> you have a little cpu idle time... and you have very low disk waits... 
> you are using very little swap.  hum... odd...
> 
> -Andy
> 

Looks like I missed an important point.  You said this was top during 
off peak time.  So ignore my high load ramblings.

But... if this is off peak, and you only have 6% idle cpu... I'd say 
your cpu bound.  (I'm still not sure what the 42.9%st is, so maybe I'm 
off base with the 6% idle too)

-Andy

In response to

Responses

pgsql-performance by date

Next:From: Gurjeet SinghDate: 2009-09-22 14:35:55
Subject: Re: Hunting Unused Indexes .. is it this simple ?
Previous:From: Andy ColsonDate: 2009-09-22 14:19:46
Subject: Re: High CPU load on Postgres Server during Peak times!!!!

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group