Re: Adding more memory = hugh cpu load

From: Greg Smith <greg(at)2ndQuadrant(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Adding more memory = hugh cpu load
Date: 2011-10-10 16:07:34
Message-ID: 4E931846.80509@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 10/10/2011 10:04 AM, Shaun Thomas wrote:
> The problem with having lots of memory is... that you have lots of
> memory. The operating system likes to cache, and this includes writes.
> Normally this isn't a problem, but with 48GB of RAM, the defaults (for
> CentOS 5.5 in particular) are to use up to 40% of that to cache writes.

I make the same sort of tuning changes Shaun suggested on every CentOS 5
system I come across. That said, you should turn on log_checkpoints in
your postgresql.conf and see whether the "sync=" numbers are high. That
will help prove or disprove that the slowdown you're seeing is from too
much write caching. You also may be able to improve that by adjusting
checkpoint_segments/checkpoint_timeout, or *decreasing* shared_buffers.
More about this at
http://www.westnet.com/~gsmith/content/postgresql/chkp-bgw-83.htm

There are some other possibilities, too, like that memory addition can
actually causing average memory speed to drop as Kevin mentioned. I
always benchmark with stream-scaling:
https://github.com/gregs1104/stream-scaling before and after a RAM size
change, to see whether things are still as fast or not. It's hard to do
that in the position you're in now though.

--
Greg Smith 2ndQuadrant US greg(at)2ndQuadrant(dot)com Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Leonardo Francalanci 2011-10-10 16:14:37 Re: Adding more memory = hugh cpu load
Previous Message Shaun Thomas 2011-10-10 15:39:08 Re: Adding more memory = hugh cpu load