Subject: Re: failing to keep a process from swapping
To: Arto Selonen <arto+dated+1098440395.1f79be3692c0034b@selonen.org>
From: Chris Gilbert <chris@dokein.co.uk>
List: tech-kern
Date: 10/23/2004 12:58:42
On Fri, 22 Oct 2004 13:18:52 +0300 (EEST)
Arto Selonen <arto@selonen.org> wrote:

> Hi!
> 
> On October 7th, I sent the following to current-users:
> 
> 	http://mail-index.netbsd.org/current-users/2004/10/07/0014.html
> 
> Since I got no replies to that one, I'm making another effort here.
> 
> Basically, what I am trying to achieve is to keep 'squid' in memory.
> I've set the following limits (after having sent the above email):
> 
> 	vm.anonmin = 65
> 	vm.execmin = 2
> 	vm.filemin = 10
> 	vm.anonmax = 80
> 	vm.execmax = 5
> 	vm.filemax = 15

They would seem reasonable values for what you're trying to do.

Might be worth watching the output of sysutils/xuvmstat see if it shows anything odd (although not sure how I'd define odd)  Probably things like not having enough free pages etc.  If there are stats missing you're interested in you can add them fairly easily.  eg I suspect you might want a line telling you the types of pages being activated again.

The code that decides what to keep and what to throw out is in uvm_pdaemon, uvmpd_scan_inactive(), so reading that might help point you at what's going wrong.

Thanks,
Chris