Re: fix use of posix_fadvise in xlog.c

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Mark Wong <markwkm(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: fix use of posix_fadvise in xlog.c
Date: 2010-06-10 21:34:29
Message-ID: 4C115A65.5010300@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
>
>> In a steady-state situation new WAL files are not created very often
>> because we recycle old ones, so it probably doesn't make much difference.
>>
>
> Yeah. We really don't worry too much about the performance of the
> new-WAL-file-creation code path because of this.
>

The only situation where the WAL zeroing path turns ugly is if you
launch a bunch of activity against a fresh server that doesn't have any
segments to recycle yet. The last time we talked about improving that,
the best idea I thought came out was to be better about preallocating
segments than the code already is, rather than trying to speed up how
the kernel deals with the situation. See the links for "Be more
aggressive about creating WAL files" at http://wiki.postgresql.org/wiki/Todo

I'm also not very optimistic about adding more posix_fadvise calls
really helping just because the implementations of those are so
unpredictable across operating systems. I'm sure that Mark could figure
out the right magic to speed up this specific case on Linux, but have my
doubts that work would translate very well to many other operating
systems. Whereas a more generic preallocation improvement would help
everywhere.

--
Greg Smith 2ndQuadrant US Baltimore, MD
PostgreSQL Training, Services and Support
greg(at)2ndQuadrant(dot)com www.2ndQuadrant.us

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2010-06-10 21:54:43 Bug / shortcoming in has_*_privilege
Previous Message Robert Haas 2010-06-10 20:39:50 including backend ID in relpath of temp rels - updated patch