From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jim C. Nasby <jnasby@pervasive.com>
Cc: Mikael Carneholm <Mikael.Carneholm@WirelessCar.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Migration study, step 1: bulk write performanceoptimization
Date: Wed, 22 Mar 2006 09:34:55 -0500
Message-ID: <16142.1143038095@sss.pgh.pa.us> (raw)
In-Reply-To: <20060322125516.GB15742@pervasive.com>
References: <7F10D26ECFA1FB458B89C5B4B0D72C2B08828E@sesrv12.wirelesscar.com>
<20060322125516.GB15742@pervasive.com>
"Jim C. Nasby" <jnasby@pervasive.com> writes:
> On Wed, Mar 22, 2006 at 10:04:49AM +0100, Mikael Carneholm wrote:
>> It does ("LOG: checkpoints are occurring too frequently (2 seconds apart)") However, I tried increasing checkpoint_segments to 32 (512Mb) making it checkpoint every 15 second or so, but that gave a more uneven insert rate than with checkpoint_segments=3. Maybe 64 segments (1024Mb) would be a better value? If I set checkpoint_segments to 64, what would a reasonable bgwriter setup be? I still need to improve my understanding of the relations between checkpoint_segments <-> shared_buffers <-> bgwriter... :/
> Probably the easiest way is to set checkpoint_segments to something like
> 128 or 256 (or possibly higher), and then make bg_writer more aggressive
> by increasing bgwriter_*_maxpages dramatically (maybe start with 200).
Definitely. You really don't want checkpoints happening oftener than
once per several minutes (five or ten if possible). Push
checkpoint_segments as high as you need to make that happen, and then
experiment with making the bgwriter parameters more aggressive in order
to smooth out the disk write behavior. Letting the physical writes
happen via bgwriter is WAY cheaper than checkpointing.
bgwriter parameter tuning is still a bit of a black art, so we'd be
interested to hear what works well for you.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, jnasby@pervasive.com, Mikael.Carneholm@WirelessCar.com, simon@2ndquadrant.com
Subject: Re: Migration study, step 1: bulk write performanceoptimization
In-Reply-To: <16142.1143038095@sss.pgh.pa.us>
References: <7F10D26ECFA1FB458B89C5B4B0D72C2B08828E@sesrv12.wirelesscar.com> <20060322125516.GB15742@pervasive.com> <16142.1143038095@sss.pgh.pa.us>
* 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