Re: [PATCHES] ARC Memory Usage analysis

From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] ARC Memory Usage analysis
Date: 2004-10-25 17:14:39
Message-ID: 87mzyavhxc.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches pgsql-performance


Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> However, I'm still really nervous about the idea of using
> effective_cache_size to control the ARC algorithm. That number is
> usually entirely bogus.

It wouldn't be too hard to have a port-specific function that tries to guess
the total amount of memory. That isn't always right but it's at least a better
ballpark default than a fixed arbitrary value.

However I wonder about another approach entirely. If postgres timed how long
reads took it shouldn't find it very hard to distinguish between a cached
buffer being copied and an actual i/o operation. It should be able to track
the percentage of time that buffers requested are in the kernel's cache and
use that directly instead of the estimated cache size.

Adding two gettimeofdays to every read call would be annoyingly expensive. But
a port-specific function to check the cpu instruction counter could be useful.
It doesn't have to be an accurate measurement of time (such as on some
multi-processor machines) as long as it's possible to distinguish when a slow
disk operation has occurred from when no disk operation has occurred.

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Lamar Owen 2004-10-25 17:34:36 RPMS, time, and other things.
Previous Message Tom Lane 2004-10-25 17:09:42 Re: rmtree() failure on Windows

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2004-10-25 21:01:39 Re: rmtree() failure on Windows
Previous Message Tom Lane 2004-10-25 17:09:42 Re: rmtree() failure on Windows

Browse pgsql-performance by date

  From Date Subject
Next Message Manfred Spraul 2004-10-25 17:30:38 Re: futex results with dbt-3
Previous Message Josh Berkus 2004-10-25 17:09:17 Re: different io elevators in linux