Re: [PATCHES] ARC Memory Usage analysis
Greg Stark <gsstark@mit.edu>
From: Greg Stark <gsstark@mit.edu>
To: Greg Stark <gsstark@MIT.EDU>
Cc: pgsql-hackers@postgresql.org
Date: 2004-10-25T21:30:52Z
Lists: pgsql-hackers, pgsql-performance
Attachments
Greg Stark <gsstark@MIT.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: