Subject: Re: Swap overcommit
To: Danny Thomas <D.Thomas@vthrc.uq.edu.au>
From: Matthew Dillon <dillon@apollo.backplane.com>
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.
		endif
	    endif
	endif
    end

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

    Problem solved.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>