Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Mar 2003 21:24:20 -0600
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>, Wes Peters <wes@softweyr.com>, freebsd-arch@FreeBSD.ORG
Subject:   Re: Patch to protect process from pageout killing
Message-ID:  <20030325032420.GA22424@dan.emsphone.com>
In-Reply-To: <20030325012844.GB4406@HAL9000.homeunix.com>
References:  <200303240823.48262.wes@softweyr.com> <7019.1048523782@critter.freebsd.dk> <20030324213519.GA63147@dan.emsphone.com> <20030325012844.GB4406@HAL9000.homeunix.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Mar 24), David Schultz said:
> Thus spake Dan Nelson <dnelson@allantgroup.com>:
> > How about changing the kill logic to look at RLIMIT_RSS?  The
> > process exceeding its limit by the largest amount gets killed. 
> > That way you can exempt certain processes by raising their limit. 
> > Set named's limit to say 10MB, and when memory gets tight the
> > system will see it's exceeding its quota by 20MB and kill it first.
> 
> I think that's overengineering the problem.  First of all, it means
> that on any system where RLIMIT_RSS is unlimited by default, the
> machine now deadlocks when it runs out of memory.  Second, it is only
> marginally useful to go as far as specifying priorities and quotas
> and such on process killability.  Most of the time, people can divide
> the processes on thier system into two categories: critical and
> killable.

RSS overcommit would be the first sort priority.  If nothing is over
its limit, you fall back on the old "biggest process dies" rule.  Set
the critical processes at an infinite RSS, set the killable ones at a
reasonable RSS, set your cannon fodder processes at 0.  The default RSS
is infinity so you get classic behaviour.

In the embedded server case, there's no swap space so the RSS limit
isn't even being used anyway.  There is still the inheritance problem,
though, so a RSS=inf daemon would have to manually set the rlimit to 0
after forking a killable process.

-- 
	Dan Nelson
	dnelson@allantgroup.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030325032420.GA22424>