NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Using swap though there's plenty of mem free



On Thu, May 01, 2008 at 11:05:04PM +0200, Jonathan Schleifer wrote:
> Matthias Scheler <tron%zhadum.org.uk@localhost> wrote:
> 
> > What would be the sense in keeping allocated pages in memory even if
> > they haven't accessed for hours? Using the memory e.g. as disk
> > buffers will reduce the total amount of disk I/O which is what
> > a modern VM system tries to achieve.
> 
> That may be true for a desktop system, but NEVER for a server system.
> If lighttpd is swapped because it wasn't used for some time, that's
> bad.

Nonsense.  To begin with, you're confusing paging and swapping.  I would be
astonished to see that your http server process actually got _swapped_ out,
and I wonder why you think it did.

Any server system is almost guaranteed to have pages of file data which
are, in fact, more recently and more frequently used than some pages of
its server executables -- and which, therefore, should be preferred for
retention in core.

I'm sure you think you know a better algorithm than LRU for page
replacement.  Everyone seems to think that he does at one point or another
and usually these involve "obvious" heuristics about kinds of things which
are stored in pages.  Unfortunately, careful study almost always shows
that such algorithms sometimes, often, or always perform worse than plain
old boring LRU would.

Every once in a while someone comes up with an algorithm that actually
_does_ beat LRU for real-world workloads.  You might look at ARC for one
example of such.  However, "blindly prefer pages from executable programs"
is not, I'm afraid, such an example.

Thor


Home | Main Index | Thread Index | Old Index