Subject: Re: managing process memory limits on the fly?
To: Carl Brewer <carl@bl.echidna.id.au>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: netbsd-users
Date: 02/21/2007 21:16:18
On Thu, 22 Feb 2007 13:04:07 +1100
Carl Brewer <carl@bl.echidna.id.au> wrote:

> Jeff Rizzo wrote:
> > Carl Brewer wrote:
> >> ahha,  I've just doubled the soft limit to 256MB, and will see how
> >> it goes.
> >> Thankyou.
> >> Is it possible to do this for a particular account only?  I
> >> have a 'zope' user that I want to be able to use a lot of memory
> >> and it would be handy if I could let it do that?  I assume
> >> sysctl or limit|ulimit will let me change soft limits as that
> >> user in a login script or startup script or something?, or is it
> >> more elegant/correct to do it elsewhere?
> > > You can either do it in your shell configuration (with ulimit),
> > > or in
> > login.conf.
> 
> ok, does that work with a process that starts as root (run from an
> rc.d script) that then changes itself to another user?
> 
> ie: if I set 'zope' to have a soft memory limit of 256MB
> in login.conf, would that apply?  Or is that only run if/when
> a user account is logged in?
> 
I believe it only applies via login.  If you have a root process
starting the zope process, have the root process change its soft (or
hard) limit before invoking the 'su' command.


		--Steve Bellovin, http://www.cs.columbia.edu/~smb