From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Greg Mennie <gjm@caledoncard.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: hanging for 30sec when checkpointing
Date: Thu, 12 Feb 2004 21:09:49 -0500 (EST)
Message-ID: <200402130209.i1D29nN09976@candle.pha.pa.us> (raw)
In-Reply-To: <a806dcd9.0402110625.3190f48c@posting.google.com>
Greg Mennie wrote:
> me@shanewright.co.uk (Shane Wright) wrote in message news:<40202216.4010608@shanewright.co.uk>...
> > Hi,
> >
> > I'm running a reasonable sized (~30Gb) 7.3.4 database on Linux and I'm
> > getting some weird performance at times.
> >
> > When the db is under medium-heavy load, it periodically spawns a
> > 'checkpoint subprocess' which runs for between 15 seconds and a minute.
> > Ok, fair enough, the only problem is the whole box becomes pretty much
> > unresponsive during this time - from what I can gather it's because it
> > writes out roughly 1Mb (vmstat says ~1034 blocks) per second until its done.
> >
> > Other processes can continue to run (e.g. vmstat) but other things do
> > not (other queries, mostly running 'ps fax', etc). So everything gets
> > stacked up till the checkpoint finishes and all is well again, untill
> > the next time...
>
> I am having a similar problem and this is what I've found so far:
>
> During the checkpoint the volume of data that's written isn't very
> high and it goes on for a fairly long time (up to 20 seconds) at a
> rate that appears to be well below our disk array's potential. The
> volume of data written is usually 1-5 MB/sec on an array that we've
> tested to sustain over 50 MB/sec (sequential writes, of course).
>
> It turns out that what's going on is that the command queue for the
> RAID array (3Ware RAID card) is filling up during the checkpoint and
> is staying at the max (254 commands) for most of the checkpoint. The
> odd lucky insert appears to work, but is extremely slow. In our case,
> the WAL files are on the same array as the data files, so everything
> grinds to a halt.
>
> The machine we're running it on is a dual processor box with 2GB RAM.
> Since most database read operations are being satisfied from the
> cache, reading processes don't seem to be affected during the pauses.
>
> I suspect that increasing the checkpoint frequency could help, since
> the burst of commands on the disk channel would be shorter. (it's
> currently 300 seconds)
>
> I have found that the checkpoint after a vacuum is the worst. This
> was the original problem which led to the investigation.
>
> Besides more frequent checkpoints, I am at a loss as to what to do
> about this. Any help would be appreciated.
My guess is that the background writer will improve checkpoint
performance greatly in 7.5. Jan has run tests that show the background
writer really reduces the checkpoint write storm.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
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-admin@postgresql.org
Cc: pgman@candle.pha.pa.us, gjm@caledoncard.com
Subject: Re: hanging for 30sec when checkpointing
In-Reply-To: <200402130209.i1D29nN09976@candle.pha.pa.us>
References: <a806dcd9.0402110625.3190f48c@posting.google.com> <200402130209.i1D29nN09976@candle.pha.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