Re: OS cached buffers (was: Support Parallel Query Execution

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
Cc: Luke Lonergan <llonergan(at)greenplum(dot)com>, Skype Technologies OY <hannu(at)skype(dot)net>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Myron Scott <lister(at)sacadia(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: OS cached buffers (was: Support Parallel Query Execution
Date: 2006-04-13 19:38:04
Message-ID: 200604131938.k3DJc5A21801@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Jim C. Nasby wrote:
> On Mon, Apr 10, 2006 at 12:02:56PM -0700, Luke Lonergan wrote:
> > Hannu,
> >
> > On 4/10/06 2:23 AM, "Hannu Krosing" <hannu(at)skype(dot)net> wrote:
> >
> > >> The cost of fetching a page from the OS is not really much of an
> > >> overhead,
> > >
> > > Have you tested this ?
> >
> > I have - the overhead of fetching a page from Linux I/O cache to buffer
> > cache is about an additional 20% over fetching it directly from buffer cache
> > on PG 7.4.
>
> Is there any pratcical way to tell the difference between a page comming
> from the OS cache and one comming from disk? Or maybe for a set of pages
> an estimate on how many came from cache vs disk? There's some areas
> where having this information would be very useful, such as for vacuum
> delay. It would make tuning much easier, and it would also give us some
> insight on how heavily loaded disks were, which would also be useful
> info for vacuum to have (so we could adjust vacuum_cost_delay
> dynamically based on load).

getrusage() returns:

! 0.000062 elapsed 0.000000 user 0.000062 system sec
! [0.000000 user 0.009859 sys total]
! 0/0 [19/2] filesystem blocks in/out
! 0/0 [0/0] page faults/reclaims, 0 [0] swaps
! 0 [0] signals rcvd, 0/0 [4/5] messages rcvd/sent
! 0/0 [23/6] voluntary/involuntary context switches

but I don't see anything in there that would show kernel cache vs. disk
I/O. In fact, there is usually little connection in the kernel between
an I/O request and the process that requests it.

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2006-04-13 19:42:44 Re: Practical impediment to supporting multiple SSL libraries
Previous Message Stephen Frost 2006-04-13 19:29:41 Re: Practical impediment to supporting multiple SSL libraries

Browse pgsql-patches by date

  From Date Subject
Next Message Jim C. Nasby 2006-04-14 04:45:05 Re: OS cached buffers (was: Support Parallel Query Execution
Previous Message Simon Riggs 2006-04-13 18:07:25 pg_ctl options checking