*BSD News Article 52681


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.uwa.edu.au!classic.iinet.com.au!swing.iinet.net.au!news.uoregon.edu!news.sprintlink.net!howland.reston.ans.net!newsfeed.internetmci.com!news.mathworks.com!newshost.marcam.com!news.netins.net!news.dmacc.cc.ia.us!news.dmacc.cc.ia.us!not-for-mail
From: cfr@dmacc.cc.ia.us (Charles F. Randall)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: can't fork?
Date: 12 Oct 1995 14:13:27 -0500
Organization: Des Moines Area Community College, Ankeny, Iowa (USA)
Lines: 60
Distribution: inet
Message-ID: <45jpcn$q8f@Apollo.dmacc.cc.ia.us>
References: <bobfe.165.0DEA9EC0@ids.net>
Reply-To: "Charles F. Randall" <crandall@dmacc.cc.ia.us>
NNTP-Posting-Host: apollo.dmacc.cc.ia.us

[Note: sent via e-mail and posted to comp.unix.bsd.freebsd.misc]

Bob Fayne - IDS Tech Support <bobfe@ids.net> wrote:
>Can I recompile my kernel to allow for more processes?  (assuming that's the 
>problem)

For information on building a custom kernel, see the online FreeBSD
Handbook (Chapter 5, "Configuring the FreeBSD Kernel").

   http://www.freebsd.org/How/handbook/handbook50.html


In section 5.3.1, it states

  "... the most important table set by maxusers is the maximum number of
  processes, which is set to 20 + 16 * maxusers, ..."

Read that section carefully for more information.

Look in the LINT kernel (/usr/src/sys/i386/conf/LINT) and you'll see
the following:

--- snip ---
#
# The maxusers' parameter controls the static sizing of a number of
# internal system tables by a complicated formula defined in param.c.
#
maxusers        10
--- snip ---

and

--- snip ---
  #
  # Under some circumstances it is necessary to make the default max
  # number of processes per user and open files per user more than the
  # defaults on bootup.  (an example is a large news server in which
  # the uid, news, can sometimes need > 100 simultaneous processes
  running)
  options         "CHILD_MAX=128"
  options         "OPEN_MAX=128"
--- snip ---

Experiment with these parameters.

On my system, I see:

% sysctl -a | grep -i proc
kern.maxproc = 180
kern.maxfilesperproc = 360
kern.maxprocperuid = 179

Check the manual page for the sysctl command. Also,
/usr/src/sys/conf/param.c contains the code that sets these
parameters. It may help to take a quick peek there.

-Randy
-- 
Charles F. Randall              E-mail: crandall@dmacc.cc.ia.us
UNIX Systems Programmer         Voice:  (515) 965-7057  FAX: (515) 965-7305