Subject: Re: NetBSD weakness..
To: User Andrea <andrea@practive.org>
From: Jeff Rizzo <riz@boogers.sf.ca.us>
List: port-i386
Date: 10/03/2001 09:24:51
On Wed, Oct 03, 2001 at 12:41:01PM +0000, User Andrea wrote:
> Thor Lancelot Simon wrote:
> > On Tue, Oct 02, 2001 at 04:51:45PM +0200, Andrea wrote:
> > > 2) Often i got a 'No More Process' error
> > 
> > This means that there's something very, very wrong with your
> > configuration; something (perhaps your login script?) is running a huge
> > number of processes that don't exit.
> > 
> What do you mean with 'huge'?
> What's the maximum number of processes allowed in a standard NetBSD
> installation?Can i change it at compile time?
> 
> 'Cause my job i need a large number of terminal open at same time 
> (sometime > 300) is this a 'normal' number?

That's a pretty large number, and you may in fact be hitting limits.
You can check with sysctl:

hubba:riz  ~> sysctl -a |grep maxproc
kern.maxproc = 1044
proc.curproc.rlimit.maxproc.soft = 160
proc.curproc.rlimit.maxproc.hard = 1044

(this is on my system).  What this shows is that my current process (the
shell I ran this on) has a soft limit of 160 processes it can spawn.
This limit can be raised with either the ulimit command (unlimit in csh), or sysctl.
(Using sysctl to raise the limit for "curproc", however, only raises
it for the sysctl command itself... you'd want to replace "curproc"
with the process ID of the process whose limit you wanted to raise)

The kern.maxproc shows the total number of processes the system can
have.  This can also be raised with sysctl. (You'd probably want to raise
that one in /etc/sysctl.conf, so it would persist on reboot)

To raise the current process's limit:
hubba:riz  ~> sysctl -w proc.curproc.rlimit.maxproc.soft=600
proc.curproc.rlimit.maxproc.soft: 160 -> 600

hubba:riz  ~> sysctl -a |grep maxproc
kern.maxproc = 1044
proc.curproc.rlimit.maxproc.soft = 160
proc.curproc.rlimit.maxproc.hard = 1044

hubba:riz  ~> unlimit maxproc
hubba:riz  ~> sysctl -a | grep maxproc
kern.maxproc = 1044
proc.curproc.rlimit.maxproc.soft = 1044
proc.curproc.rlimit.maxproc.hard = 1044

...notice the higher "soft" value.

> 
> Another question about login ... When i need superuser privileges i
> noticed that it's not fast as i was used with freebsd to switch from
> 'normal user' to root.After the password request it requires some
> seconds to give me the shell prompt.
> What's the exact sequence of process involved in  'su -' ?

I'll let someone else handle this one for you...

+j