From: David Kerr <dmk@mr-paradox.net>
To: Maxim Boguk <maxim.boguk@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Massive I/O spikes during checkpoint
Date: Mon, 09 Jul 2012 23:17:48 -0700
Message-ID: <4FFBC90C.1060205@mr-paradox.net> (raw)
In-Reply-To: <CAK-MWwTP8ML8AZKWXa2D6-ghjuBKeGw38w+Kp92oWF2QCd6PFQ@mail.gmail.com>
References: <27C32FD4-0142-44FE-8488-9F366DC75966@mr-paradox.net>
<CAK-MWwRw-Y7_VhtjKcsC38NQK0eL-J9crHvjT=0GbXZxXdd+JA@mail.gmail.com>
<07928283-528B-4499-BEC2-7E9098D6D734@mr-paradox.net>
<CAK-MWwTP8ML8AZKWXa2D6-ghjuBKeGw38w+Kp92oWF2QCd6PFQ@mail.gmail.com>
On 7/9/2012 11:14 PM, Maxim Boguk wrote:
>
>
> On Tue, Jul 10, 2012 at 4:03 PM, David Kerr <dmk@mr-paradox.net
> <mailto:dmk@mr-paradox.net>> wrote:
>
>
> On Jul 9, 2012, at 10:51 PM, Maxim Boguk wrote:
>
>>
>>
>> But what appears to be happening is that all of the data is
>> being written out at the end of the checkpoint.
>>
>> This happens at every checkpoint while the system is under load.
>>
>> I get the feeling that this isn't the correct behavior and
>> i've done something wrong.
>>
>>
>>
>> It's not an actual checkpoints.
>> It's is a fsync after checkpoint which create write spikes hurting
>> server.
>> You should set sysctl vm.dirty_background_bytes and vm.dirty_bytes
>> to reasonable low values
>
> So use bla_bytes instead of bla_ratio?
>
>
> Yes because on 256GB server
> echo 10 > /proc/sys/vm/dirty_ratio
> is equivalent to 26Gb dirty_bytes
>
> and
> echo 5 >/proc/sys/vm/dirty_background_ratio
> is equivalent to 13Gb dirty_background_bytes
>
> It is really huge values.
<sigh> yeah, I never bothered to think that through.
> So kernel doesn't start write any pages out in background before it has
> at least 13Gb dirty pages in kernel memory.
> And at end of the checkpoint kernel trying flush all dirty pages to disk.
>
> Even echo 1 >/proc/sys/vm/dirty_background_ratio is too high value for
> contemporary server.
> That is why *_bytes controls added to kernel.
Awesome, Thanks.
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: dmk@mr-paradox.net, maxim.boguk@gmail.com
Subject: Re: Massive I/O spikes during checkpoint
In-Reply-To: <4FFBC90C.1060205@mr-paradox.net>
* 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