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

Re: Free WAL caches on switching segments

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: ITAGAKI Takahiro <itagaki(dot)takahiro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Free WAL caches on switching segments
Date: 2006-02-12 06:10:14
Message-ID: 200602120610.k1C6AEF17450@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
I looked this over and I am unsure what this does for us that isn't
already accomplished using the wal_sync_method settings.  See xlog.c for
a description of O_DIRECT and when it is used.

---------------------------------------------------------------------------

ITAGAKI Takahiro wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
> 
> > > > > Here is a small patch to prevent undesired WAL file caching by kernel.
> > > > > posix_fadvise(POSIX_FADV_DONTNEED) attempts to free cached pages and
> > > > > the kernel will discard them in preference to other data caches.
> > > > 
> > > > On plenty of platforms, this won't even compile ...
> > 
> > Yes, but we probably have to have a configure test to see if
> > posix_fadvise exists too.  I will keep this for 8.2.
> 
> I think we can use _POSIX_ADVISORY_INFO to test if posix_fadvise exists.
> Also, I added the check on whether WAL archiving is enabled, because
> archivers might use the caches to read the WAL segment.
> 
> 
> By the way, should we put posix_fadvise on the separated place with renaming
> pg_fadvise? If we use posix_fadvise in other purposes, for example,
> read-ahead control, the separation would be good to keep codes clean.
> 
> ---
> ITAGAKI Takahiro
> NTT Cyber Space Laboratories
> 

[ Attachment, skipping... ]

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

Responses

pgsql-patches by date

Next:From: Bruce MomjianDate: 2006-02-12 06:12:42
Subject: Re: To build client can on Windows using Microsoft Visual
Previous:From: Bruce MomjianDate: 2006-02-12 05:33:12
Subject: Re: list of scalars for fors and fore stms II

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