pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-performance@postgresql.org, Vivek Khera <khera@kcilink.com>
Subject: Re: pg_restore taking 4 hours!
Date: Mon, 13 Dec 2004 14:21:04 -0500
Message-ID: <27280.1102965664@sss.pgh.pa.us> (raw)
In-Reply-To: <200412131043.28465.josh@agliodbs.com>
References: <41ADA82A.7070405@carvalhaes.net>
	<200412131025.54587.josh@agliodbs.com>
	<83210A57-4D35-11D9-9C22-000A9578CFCC@kcilink.com>
	<200412131043.28465.josh@agliodbs.com>

Josh Berkus <josh@agliodbs.com> writes:
> Not as much, but it's still a good idea to serialize the load.   With too few
> segments, you get a pattern like:

> Fill up segments
> Write to database
> Recycle segments
> Fill up segments
> Write to database
> Recycle segments 
> etc.

Actually I think the problem is specifically that you get checkpoints
too often if either checkpoint_timeout or checkpoint_segments is too
small.  A checkpoint is expensive both directly (the I/O it causes)
and indirectly (because the first update of a particular data page
after a checkpoint causes the whole page to be logged in WAL).  So
keeping them spread well apart is a Good Thing, as long as you
understand that a wider checkpoint spacing implies a longer time to
recover if you do suffer a crash.

I think 8.0's bgwriter will considerably reduce the direct cost of
a checkpoint (since not so many pages will be dirty when the checkpoint
happens) but it won't do a thing for the indirect cost.

			regards, tom lane



view thread (15+ messages)  latest in thread

Message-ID: <27280.1102965664@sss.pgh.pa.us>
Permalink:  ../27280.1102965664@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27280.1102965664@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, josh@agliodbs.com, khera@kcilink.com
  Subject: Re: pg_restore taking 4 hours!
  In-Reply-To: <27280.1102965664@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