In a nutshell, my problem was that Digital UNIX is configured to
maximize interactive performance by default. If all of the memory is
used up for more than 5sec, then the most offending process is
automatically swapped out (ie., all of its pages are cleared from
memory and written to disk). In my case, I am running a program that
always using nearly all available memory. So when I type "ps aux",
that suddenly uses up all the memory and the system completely swaps
out my program.
To be precise, the system employs two competing rules.
1: When the number of free pages falls below vm-page-free-optimal
for more than 5sec, then the system will swap out all pages
owned by the most obnoxious process.
2: When the number of free pages falls below vm-page-free-min,
then the system starts to write old pages out to disk until it
has cleared vm-page-free-target pages.
I want rule 2 to block rule 1. That means lowering
vm-page-free-optimal (default=72) below vm-page-free-min (default=20),
but keeping both above vm-page-free-reserved (default=10). So I
increased vm-page-free-min to 40 and decreased vm-page-free-optimal to
20, which works satisfactorily. Since I have plenty of memory, I also
doubled vm-page-free-target from default=128 to 256, although this was
probably not necessary.
I also adjusted two more parameters. Since I have two swap disks, I
doubled vm-asyncswapbuffers from the default=4 to 8 so that paging
will go faster. And I also doubled vm-page-prewrite-target from the
default=256 to 512 in an attempt to prempt rule 2 from firing.
This is all explained in
http://www.UNIX.digital.com/faqs/publications/base_doc/DOCUMENTATION/HTML/AA-Q0R3E-TET1_html/tune6.html#attributes_ax
Other issues:
1. When you have multiple swap partitions, the system ignores any
attempt to set priorities and just uses them round-robin.
There are three ways to try to set priority
via /sbin/swapdefault
via /etc/fstab mnt_point = swap1 or swap2
via /etc/fstab mnt_options = sw,pri=0...b4
but none has any effect.
2. There are two ways to configure swapping in general
"lazy" - all memory is copied to disk, so your maximum
available memory is max(ram,swap). [default]
"eager" - overflow memory is copied to disk, so your maximum
available memory is ram+swap. [rm /sbin/swapdefault]
At first glance, "eager" mode seems like a complete win. But if
you run out of memory in "eager" mode, then the system will start
killing processes arbitrarily. It could even kill your shell
process, or some mission-critical process! So I do not recommend
that anyone use this mode unless they are sure they will never
use up all the memory. Conversely, "lazy" mode will never kill
any running process when it runs out of memory -- it will simply
deny future requests for more memory.
Thanks for all the help that this group provides,
and thanks to Digital for putting all their manuals online!
Eric
P.S. Special thanks to:
chris_at_lagoon.meo.dec.com
knut.hellebo_at_nho.hydro.com
cherkus_at_homerun.unimaster.com
bert.deknuydt_at_esat.kuleuven.ac.be
tpb_at_zk3.dec.com
alan_at_nabeth.cxo.dec.com
gadbois_at_cyc.com
alpha_at_jungle.deceiver.org
Received on Thu Apr 10 1997 - 23:39:53 NZST