pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Smith <greg@2ndQuadrant.com>
To: pgsql-performance@postgresql.org
Subject: Re: Adding more memory = hugh cpu load
Date: Mon, 10 Oct 2011 12:07:34 -0400
Message-ID: <4E931846.80509@2ndQuadrant.com> (raw)
In-Reply-To: <4E92FB87.1030703@peak6.com>
References: <4E92F294.9010405@gmail.com>
	<4E92FB87.1030703@peak6.com>

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@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us




view thread (24+ messages)  latest in thread

Message-ID: <4E931846.80509@2ndQuadrant.com>
Permalink:  ../4E931846.80509@2ndQuadrant.com/
Also on:    postgresql.org/message-id/4E931846.80509@2ndQuadrant.com

 · 

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: greg@2ndQuadrant.com
  Subject: Re: Adding more memory = hugh cpu load
  In-Reply-To: <4E931846.80509@2ndQuadrant.com>

* 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