[olug] Tweaking swapping in 2.6.X kernels...
Daniel Linder
dan at linder.org
Tue Sep 28 18:17:13 UTC 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
(Hope this helps others who seem to have doggy machines... -- Dan)
My workstation is a Compaq P4-3.06GHz w/1GB RAM and a 60GBB 7200 HDD
running Fedora Core FC3 Test 1 (kernel 2.6.8-1.540smp) -- in otherwords,
plenty of power for most workloads.
When I would start some large programs running (Firefox, X11, xmms, and
two instances of VMWare), there would be times that the performance of the
system would go down the tubes and become nearly intolerable to use. I
noticed the HDD light was on solid during these instances, and the vmstat
output was showing that the swapin/swapout counters were high and the
"Waiting for IO" was through the roof (85%+).
I stumbled across some discussion of the new "swappiness" factor the new
kernels support via the "/proc" filesystem. The number that my system was
set to initially was "60" (it can range from 0 to 100) -- the lower the
number the more agressively the system will try to hold things in RAM
before swapping them out. I lowered this to "25" and the performance is
extremely responsive now. You can do this by executing the following as
root:
echo 25 > /proc/sys/vm/swappiness
(You will have to do this each time you reboot, so add the following line
to your /etc/rc.local once you find a value you like.)
These numbers aren't a science yet, so my value might not work in your
situation, and could easily be a bad value when my system gets an
newer/different kernel...YMMV.
Good luck, hope this helps!
Dan
- - - - -
"I do not fear computer,
I fear the lack of them."
-- Isaac Asimov
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQFBWaqpNiBNyqUzGb8RAmilAKCCflqncyNKDmBDZKzOoCe4dUIRQQCdGaUb
0Co1dMDUU4Wu0yEBXHJLgto=
=F+fe
-----END PGP SIGNATURE-----
More information about the OLUG
mailing list