Re: [PATCHES] ARC Memory Usage analysis

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

Greg Stark <gsstark(at)MIT(dot)EDU> writes:

> 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.

I tested this with a program that times seeking to random locations in a file.
It's pretty easy to spot the break point. There are very few fetches that take
between 50us and 1700us, probably they come from the drive's onboard cache.

The 1700us bound probably would be lower for high end server equipment with
10k RPM drives and RAID arrays. But I doubt it will ever come close to the
100us edge, not without features like cache ram that Postgres would be better
off considering to be part of "effective_cache" anyways.

So I would suggest using something like 100us as the threshold for determining
whether a buffer fetch came from cache.

Here are two graphs, one showing a nice curve showing how disk seek times are
distributed. It's neat to look at for that alone:

Attachment Content-Type Size
image/png 3.0 KB
image/png 2.4 KB
timing.c text/x-csrc 1.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-10-25 21:43:46 Re: Using ALTER TABLESPACE in pg_dump
Previous Message Tom Lane 2004-10-25 21:15:23 Re: rmtree() failure on Windows

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-10-25 21:53:25 Re: [PATCHES] ARC Memory Usage analysis
Previous Message Tom Lane 2004-10-25 21:15:23 Re: rmtree() failure on Windows

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2004-10-25 21:53:25 Re: [PATCHES] ARC Memory Usage analysis
Previous Message Rod Taylor 2004-10-25 21:19:14 Re: can't handle large number of INSERT/UPDATEs