pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Brian Fehrle <brianf@consistentstate.com>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: Kevin Kempter <kevink@consistentstate.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: background writer being lazy?
Date: Tue, 01 Nov 2011 13:14:59 -0600
Message-ID: <4EB04533.4080905@consistentstate.com> (raw)
In-Reply-To: <4EAFF7C502000025000428F2@gw.wicourts.gov>
References: <4EAF2F20.7080205@consistentstate.com>
	<4EAFC2CA02000025000428D2@gw.wicourts.gov>
	<4EB03821.6090408@consistentstate.com>
	<4EAFF7C502000025000428F2@gw.wicourts.gov>


  version     | PostgreSQL 8.4.1 on x86_64-unknown-linux-gnu, compiled 
by GCC gcc (SUSE Linux) 4.3.2 [gcc-4_3-branch revision 141291], 64-bit
  bgwriter_delay   | 50ms
  bgwriter_lru_maxpages   | 500
  bgwriter_lru_multiplier   | 4
  checkpoint_segments   | 100
  checkpoint_timeout   | 40min
  checkpoint_warning   | 30min
  checkpoint_completion_target  | 0.5
  effective_cache_size   | 16GB
  effective_io_concurrency   | 4
  extra_float_digits   | 3
  max_connections | 2000
  max_stack_depth | 7MB
  shared_buffers | 16GB
  synchronous_commit | off
  temp_buffers    | 8192
  TimeZone                      | US/Pacific
  wal_buffers                   | 8MB
  work_mem                      | 64MB


Since our checkpoint_completion_target is 0.5, we complete a checkpoint 
around 20 mins after it started, and checkpoints occur like clockwork 
every 40 minutes, no extra's are forced.

Performance overall is fairly good, but of course we're trying to 
squeeze as much out of it as we can. One main thing is trying to lower 
'spikey' disk IO so that performance is more consistent at any given time.

- Brian F

On 11/01/2011 12:44 PM, Kevin Grittner wrote:
> Brian Fehrle<brianf@consistentstate.com>  wrote:
>> On 11/01/2011 08:58 AM, Kevin Grittner wrote:
>
>>> What problem are you trying to solve?
>>>
>> We're trying to offload dirty buffer writes from checkpoints and
>> from backends (not the bgwriter) to the background writer, I
>> believe with the hope that it's the same amount of disk IO, but
>> spread out evenly rather than just when a checkpoint is occurring.
>
> What version of PostgreSQL are you using?  Recent versions spread
> out the checkpoint activity using the same process which does the
> background writing, so there is no benefit from moving writes from
> its background writing phase to its distributed checkpoint phase.
> Depending on your setting of checkpoint_completion_target you are
> probably spending as much or more time spreading the checkpoint as
> doing background writing between checkpoints.  Each of the last few
> major releases has made this much better, so if you're spending time
> tweaking something prior to 9.1, you'd probably be better served
> putting that time into upgrading.
>
>>> Yes.  Writing dirty buffers when there are enough buffers
>>> available to service requests would tend to increase overall disk
>>> writes and degrade performance.  You don't have a problem unless
>>> you have a high percentage of writes from normal backends which
>>> need to flush a buffer in order to get one.
>>>
>> This seems to be the case, as buffers_backend is between
>> checkpoint_buffers and clean_buffers from pg_stat_bgwriter.
>> For example, on 2011-10-19:
>> checkpoint buffers: 622,519
>> clean_buffers:  65,879
>> clean_max_written: 56
>> backend_buffers: 460,471
>>
>> Am I reading these right in wanting to reduce backend_buffers and
>> checkpoint_buffers?
>
> Hmm.  That is a higher percentage of backend writes than I would
> like to see.  What is your shared_memory setting?  Actually, please
> show the results of the query here:
>
> http://wiki.postgresql.org/wiki/Server_Configuration
>
> How is your performance?
>
> -Kevin

view thread (5+ messages)  latest in thread

Message-ID: <4EB04533.4080905@consistentstate.com>
Permalink:  ../4EB04533.4080905@consistentstate.com/
Also on:    postgresql.org/message-id/4EB04533.4080905@consistentstate.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-admin@postgresql.org
  Cc: brianf@consistentstate.com, Kevin.Grittner@wicourts.gov, kevink@consistentstate.com
  Subject: Re: background writer being lazy?
  In-Reply-To: <4EB04533.4080905@consistentstate.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