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 1-May-08, at 12:37 PM, Jonathan Schleifer wrote:

Well, a solution would be to only cache files that were used X times in
the last Y minutes. For example, a database will be cached then. But
not a single 200 MB file that's only accessed once.

If the system doesn't always (try to) cache a file the _first_ time it is used then it loses _big_ on any possible performance gain!

Perhaps cached file pages which are not used multiple times should be more quickly lowered in priority and so be more likely to be released sooner. However my gut feel is that even this has the potential to put a big dent in the performance of quite a few common usage scenarios.

I can't find vm.filecache, thus I guess you mean vm.filemin and
vm.filemax? I'll have a look at them.

Ah, yes, sorry -- see Simon's reply too.

Here are the settings and comments I use on my systems (from /etc/ sysctl.conf) (note I leave vm.filemax at the default of 50%)

# the rest are VM pager tuning parameters
#
# Questions:  Does the pager eventually always free inactive pages
# above the vm.*max limits?  Is this worse for exec and file pages
# than it is for anon pages?  Does it even matter if inactive anon
# pages are preserved for very long?
#
# See http://www.selonen.org/arto/netbsd/vm_tune.html
# and of course http://www.ccrc.wustl.edu/pub/chuck/psgz/diss.ps.gz

# the minimum percentage of memory always (made) available for anonymous pages
#
# The default is 10, which is way too low...
#
vm.anonmin=40

# the maximum percentage of memory that will be reclaimed from others for anonymous pages
#
# The default is 80, which seems just about right, but then again it's
# unlikely that the majority of inactive anonymous pages will ever be
# reactivated so maybe this should be lowered?
#
vm.anonmax=80

# the minimum percentage of memory always (made) available for text pages
#
# The default is 5, which is way too low...
#
vm.execmin=40

# the maximum percentage of memory that will be reclaimed from others for text pages
#
# The default is 30, which seems way too low, esp. for big programs...
#
vm.execmax=50

# the minimum percentage of memory always (made) available for the file data cache
#
# The default is 10, which is much too high, even for a large-memory
# system...
#
vm.filemin=5

# the maximum percentage of memory that will be reclaimed from others for file data cache
#
# The default is 50, which may be too high for small-memory systems
# but may be about right for large-memory systems...
#
#vm.filemax=25


--
                                        Greg A. Woods; Planix, Inc.
                                        <woods%planix.ca@localhost>



Home | Main Index | Thread Index | Old Index