From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Childs <peterachilds@gmail.com>
Cc: Postgresql Performance <pgsql-performance@postgresql.org>
Subject: Re: Commit takes a long time.
Date: Thu, 03 Jan 2008 11:35:01 -0500
Message-ID: <6663.1199378101@sss.pgh.pa.us> (raw)
In-Reply-To: <a2de01dd0801030635v3491f576oabd4b3bb58d8328b@mail.gmail.com>
References: <a2de01dd0801030635v3491f576oabd4b3bb58d8328b@mail.gmail.com>
"Peter Childs" <peterachilds@gmail.com> writes:
> Using Postgresql 8.1.10 every so often I get a transaction that takes a
> while to commit.
> I log everything that takes over 500ms and quite reguallly it says things
> like
> 707.036 ms statement: COMMIT
AFAIK there are only two likely explanations for that:
1. You have a lot of deferred triggers that have to run at COMMIT time.
2. The disk system gets so bottlenecked that fsync'ing the commit record
takes a long time.
If it's #2 you could probably correlate the problem with spikes in I/O
activity as seen in iostat or vmstat.
If it is a disk usage spike then I would make the further guess that
what causes it might be a Postgres checkpoint. You might be able to
dampen the spike a bit by playing with the checkpoint parameters, but
the only real fix will be 8.3's spread-out-checkpoints feature.
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, peterachilds@gmail.com
Subject: Re: Commit takes a long time.
In-Reply-To: <6663.1199378101@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