From: Greg Stark <gsstark@mit.edu>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Christopher Petrilli <petrilli@gmail.com>
Cc: jd@commandprompt.com, "Marc G. Fournier" <scrappy@postgresql.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: Sustained inserts per sec ... ?
Date: 04 Apr 2005 23:45:47 -0400
Message-ID: <87y8bxophw.fsf@stark.xeocode.com> (raw)
In-Reply-To: <5217.1112668589@sss.pgh.pa.us>
References: <20050401140421.P18194@ganymede.hub.org>
<59d991c4050401113857086517@mail.gmail.com>
<28353.1112388128@sss.pgh.pa.us>
<59d991c4050401124638c4ab5d@mail.gmail.com>
<1112388818.3487.34.camel@jd2.commandprompt.com>
<59d991c4050401125956d6069d@mail.gmail.com>
<59d991c40504040648457808e9@mail.gmail.com>
<26454.1112629979@sss.pgh.pa.us>
<59d991c405040409094e7bbd17@mail.gmail.com>
<26669.1112631807@sss.pgh.pa.us>
<59d991c40504041846bc39a6@mail.gmail.com>
<5217.1112668589@sss.pgh.pa.us>
Tom Lane <tgl@sss.pgh.pa.us> writes:
> What I think might be happening is that the "working set" of pages
> touched during index inserts is gradually growing, and at some point it
> exceeds shared_buffers, and at that point performance goes in the toilet
> because we are suddenly doing lots of reads to pull in index pages that
> fell out of the shared buffer area.
All this is happening within a single transaction too, right? So there hasn't
been an fsync the entire time. It's entirely up to the kernel when to decide
to start writing data.
It's possible it's just buffering all the writes in memory until the amount of
free buffers drops below some threshold then it suddenly starts writing out
buffers.
> It would be interesting to watch the output of iostat or vmstat during
> this test run. If I'm correct about this, the I/O load should be
> basically all writes during the initial part of the test, and then
> suddenly develop a significant and increasing fraction of reads at the
> point where the slowdown occurs.
I think he's right, if you see a reasonable write volume before the
performance drop followed by a sudden increase in read volume (and decrease of
write volume proportionate to the drop in performance) then it's just shared
buffers becoming a bottleneck.
If there's hardly any write volume before, then a sudden increase in write
volume despite a drop in performance then I might be right. In which case you
might want to look into tools to tune your kernel vm system.
--
greg
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: gsstark@mit.edu, tgl@sss.pgh.pa.us, petrilli@gmail.com, scrappy@postgresql.org
Subject: Re: Sustained inserts per sec ... ?
In-Reply-To: <87y8bxophw.fsf@stark.xeocode.com>
* 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