Subject: Getting rid of aggressive swapping
To: None <current-users@NetBSD.ORG>
From: Christian Biere <christianbiere@gmx.de>
List: current-users
Date: 12/16/2003 01:27:08
--mP3DRpeJDSE+ciuQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi,

I always felt that NetBSD is too aggressiv WRT to swapping. 256 MB of RAM
should really be enough for my typical (desktop) usage. For example, if I u=
se
md5 after burning a CD my system would become close to unusable for
interactive usage. Especially Mozilla which is quite a memory hog (using
around 50 MB) after a little browsing becomes as responsive as dead meat. I
guess that's because most of it got swapped out and has to be swapped in.
Given that I have (practically) only one disk reading the pages from the sw=
ap
partition is very slow because it's already busy with md5 and occasionally
used by other processes. E.g., it's so slow that "md5 /cdrw/*" completes
long before the md5 for the original files on the harddisk. [ The burner
and the harddisk don't share one cable/bus. ]
Actually, for my purposes I would seldom need swap space at all but when I
tried to disable it, the kernel started a killing spree and I couldn't
start most of my applications any longer while top showed still over
100 MB used for "File". AFAIK that's mostly cache as I always see it
increasing after using md5 with huge files. I don't quite understand
why cache would be more important than "normal" memory to run a
process.

Therefore, I tried to "tune" the VM settings a little. Not saying that
I really understand these and their effect, I've settled with these
values:

vm.anonmin =3D 50
vm.anonmax =3D 90
vm.execmin =3D 5
vm.execmax =3D 90
vm.filemin =3D 5
vm.filemax =3D 10

I've also noticed that changing them during runtime had hardly any
effect (if at all) but after a reboot I don't have the problems
with poor responsiveness any longer. ATM, absolutely no swap space
is used at all although I'm mildly stressing the system.
--=20
Christian

--mP3DRpeJDSE+ciuQ
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQE/3lFc0KQix3oyIMcRApQUAKCCFhtH/bBm1bxpWO6LTAvJnal7gwCgpATG
IT/jwy7oF7KMhwtrkCdpRHY=
=n85z
-----END PGP SIGNATURE-----

--mP3DRpeJDSE+ciuQ--