Re: Spread checkpoint sync

From: Cédric Villemain <cedric(dot)villemain(dot)debian(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Greg Smith <greg(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Spread checkpoint sync
Date: 2010-11-24 02:23:49
Message-ID: AANLkTikz2mH-pJy-u_0gbVrZ5Uz_Bs=7rC4geohg-pH+@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2010/11/21 Andres Freund <andres(at)anarazel(dot)de>:
> On Sunday 21 November 2010 23:19:30 Martijn van Oosterhout wrote:
>> For a similar problem we had (kernel buffering too much) we had success
>> using the fadvise and madvise WONTNEED syscalls to force the data to
>> exit the cache much sooner than it would otherwise. This was on Linux
>> and it had the side-effect that the data was deleted from the kernel
>> cache, which we wanted, but probably isn't appropriate here.
> Yep, works fine. Although it has the issue that the data will get read again if
> archiving/SR is enabled.

mmhh . the current code does call DONTNEED or WILLNEED for WAL
depending of the archiving off or on.

This matters *only* once the data is writen (fsync, fdatasync), before
that it should not have an effect.

>
>> There is also sync_file_range, but that's linux specific, although
>> close to what you want I think. It would allow you to work with blocks
>> smaller than 1GB.
> Unfortunately that puts the data under quite high write-out pressure inside
> the kernel - which is not what you actually want because it limits reordering
> and such significantly.
>
> It would be nicer if you could get a mix of both semantics (looking at it,
> depending on the approach that seems to be about a 10 line patch to the
> kernel). I.e. indicate that you want to write the pages soonish, but don't put
> it on the head of the writeout queue.
>
> Andres
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

--
Cédric Villemain               2ndQuadrant
http://2ndQuadrant.fr/     PostgreSQL : Expertise, Formation et Support

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2010-11-24 02:33:53 Suggested "easy" TODO: pg_dump --from-list
Previous Message Cédric Villemain 2010-11-24 01:56:11 Re: final patch - plpgsql: for-in-array