Subject: Re: URGENT: Why is this happening?
To: Jon Ribbens <jon@oaktree.co.uk>
From: Jim Reid <jim@mpn.cp.philips.com>
List: netbsd-help
Date: 10/09/1997 11:56:11
>>>>> "Jon" == Jon Ribbens <jon@oaktree.co.uk> writes:
Jon> Neat. So why's it called 'MAXUSERS'? ;-) We had it set to
Jon> '4', and thought that this was overkill. (The machine never
Jon> has more than 2 users logged in at once.) I presumed it was
Jon> related to the number of ptys or something.
Ancient history. The early BSD systems used the MAXUSERS constant in
the kernel config file to size various kernel data structures such as
the proc, inode and file tables. Usually, these each got an array that
was some multiple of MAXUSERS plus a fudge factor. The config program
generated a C source file which initialised these structures.
On my FreeBSD box - my NetBSD system is unreachable - config generates
the following param.c in the compile directory:
#define NPROC (20 + 16 * MAXUSERS)
int maxproc = NPROC; /* maximum # of processes */
int maxprocperuid = NPROC-1; /* maximum # of processes per user */
int maxfiles = NPROC*2; /* system wide open files limit */
int maxfilesperproc = NPROC*2; /* per-process open files limit */
int ncallout = 16 + NPROC; /* maximum # of timer events */
This gives you the general idea. The fudge factors and so on would
yield numbers for the max number of processes or whatever that were
usually "good enough" for the typical system. ie If your expected your
VAX would have at most 30 users, you needed (say) 250 proc table slots.
So, if you're running out of file structs or whatever, you can either
increase MAXUSERS or the fudge factor(s) used to set the limit on
these resources.