Date: Thu, 30 Jan 2003 17:28:59 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: "Brian T. Schellenberger" <bschellenberger@nc.rr.com> Cc: kientzle@acm.org, Sean Hamilton <sh@bel.bc.ca>, hackers@FreeBSD.ORG Subject: Re: Random disk cache expiry Message-ID: <200301310128.h0V1Sxo5091268@apollo.backplane.com> References: <000501c2c4dd$f43ed450$16e306cf@slugabed.org> <200301302222.h0UMMfFI090349@apollo.backplane.com> <3E39BE22.8050207@acm.org> <200301301937.12407.bschellenberger@nc.rr.com>
next in thread | previous in thread | raw e-mail | index | archive | help
:I think you missed Matt's point, which is well-taken:
:
:Even if everybody accesses it sequentially, if you have 100 processes
:accessing it sequentially at the *same* time, then it would be to your
:benefit to leave the "old" pages around because even though *this*
:process won't access it again, the *next* process very well might, if
:it just happens to be reading it sequentially as well but is a little
:further behind on its sequential read.
Right, and if the same 100 processes are accessing N files sequentially
instead of just one, you get a different effect... you might blow out
your cache if the aggregate size of the N files is too large. But then
if some of those processes are accessing the same file, and other processes
were accessing different files, you might want to cache that file
but possibly not cache others, even though all the files are (for this
example) the same size. But then what if some of the processes accessing
some of those other files were from slow clients? You could get away
with not caching those files and then you might possibly be able cache
all the remaining files (being accessed by faster clients).
And so on, and so forth. It gets even more complicated when you throw
in read verses write verses read-modify-write accesses, and even more
complicated when you add other load factors (e.g. the sheer number of
connections might reduce the memory available for caching on the fly,
or trying to balance executable pages verses data pages to optimize
paging and program performance).
So there is no 'perfect' caching algorithm. There are simply too many
variables even in a well defined environment for even the best system
heuristics to cover optimally.
-Matt
Matthew Dillon
<dillon@backplane.com>
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200301310128.h0V1Sxo5091268>
