Skip site navigation (1) Skip section navigation (2)

Re: Commit takes a long time.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Peter Childs" <peterachilds(at)gmail(dot)com>
Cc: "Postgresql Performance" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Commit takes a long time.
Date: 2008-01-03 16:35:01
Message-ID: 6663.1199378101@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
"Peter Childs" <peterachilds(at)gmail(dot)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

In response to

Responses

pgsql-performance by date

Next:From: Tom LaneDate: 2008-01-03 16:59:30
Subject: Re: Linux/PostgreSQL scalability issue - problem with 8 cores
Previous:From: Sven GeislerDate: 2008-01-03 16:27:44
Subject: Re: Linux/PostgreSQL scalability issue - problem with 8 cores

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group