pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Smith <greg@2ndquadrant.com>
To: Craig James <craig_james@emolecules.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Occasional giant spikes in CPU load
Date: Wed, 07 Apr 2010 17:54:12 -0400
Message-ID: <4BBCFF04.2000508@2ndquadrant.com> (raw)
In-Reply-To: <4BBCFB12.1010306@emolecules.com>
References: <k2pda0294261004061437p9cd3810dqe9ce528b6ddb0873@mail.gmail.com>
	<m2m603c8f071004071413w1f2d2497hbbe07d9c6491848f@mail.gmail.com>
	<4BBCFB12.1010306@emolecules.com>

Craig James wrote:
> I managed to capture one such event using top(1) with the "batch" 
> option as a background process.  See output below

You should add "-c" to your batch top capture, then you'll be able to 
see what the individual postmaster processes are actually doing when 
things get stuck.

> max_connections = 1000
> shared_buffers = 2000MB
> work_mem = 256MB
> Mem:   8194800k total,  8118688k used,    76112k free,       36k buffers
> Swap:  2031608k total,   169348k used,  1862260k free,  7313232k cached

These settings appear way too high for a server with 8GB of RAM.  I'm 
not sure if max_connections is too large, or if it's work_mem that's too 
big, but one or both of them may need to be tuned way down from where 
they are now to get your memory usage under control.  Your server might 
running out of RAM during the periods where it becomes 
unresponsive--that could be the system paging stuff out to swap, which 
isn't necessarily a high user of I/O but it will block things.  Not 
having any memory used for buffers is never a good sign.

-- 
Greg Smith  2ndQuadrant US  Baltimore, MD
PostgreSQL Training, Services and Support
greg@2ndQuadrant.com   www.2ndQuadrant.us




view thread (31+ messages)  latest in thread

Message-ID: <4BBCFF04.2000508@2ndquadrant.com>
Permalink:  ../4BBCFF04.2000508@2ndquadrant.com/
Also on:    postgresql.org/message-id/4BBCFF04.2000508@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, craig_james@emolecules.com
  Subject: Re: Occasional giant spikes in CPU load
  In-Reply-To: <4BBCFF04.2000508@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