Subject: Re: Swap overcommit
To: Danny Thomas <>
From: Matthew Dillon <>
List: tech-userlevel
Date: 07/14/1999 21:28:34
:Ted Faber <faber@ISI.EDU>
:>For every strategy there's a counterstrategy.
:exactly: the disappointing thing about this whole thread is there's been
:little discussion of implementing a (tunable) policy how to handle the
:situation when resource shortage materialises.
:Overcommitment can be useful, maybe even for most people...
:>Killing the biggest is simple to implement and usually right.
:... but some people don't want that policy, at least on some of their
:systems. Does FreeBSD offer alternatives? Is so, they've been conspicuously
:absent from discussion, which might have taken things into a more
:productive vein. What do other over-committing systems offer?
:Danny Thomas

    Here's an alternative:

    whlie (1)
	sleep 60
	blah blah blah run pstat -s, get available swap.
	if available swap < 200MB then
	    blow away some non-critical processes
	    if no non-critical processes remain
		blow away everything not owned by root and
		yell for help.
		if no no-root processes remain
		    do nothing. let the kernel blow away 
		    the biggest process when swap actually
		    runs out.

    How long do you suppose it would take to actually write that
    script?  One hour?  Two hours?  Not long, I think.

    Problem solved.

					Matthew Dillon