[comp.sys.sun] extending the max number of open files.

meulenbr@cstw01.prl.philips.nl (Frans Meulenbroeks) (07/17/89)

Can someone tell me how I can extend the max. number of open files?  I've
obtained a program which opens a lot of files, and I would prefer not to
modify the program. 

Regards,
Frans Meulenbroeks        (meulenbr@cst.prl.philips.nl)
	Centre for Software Technology
	( or try: ...!mcvax!phigate!prle!cst!meulenbr)

mr@racal-itd.co.uk (Martin Reed) (07/21/89)

Sorry, but you can't. At least, not under SunOS up to 4.0.1 (and probably
not under 4.0.3). Possibly under 4.1 (but not certain).  One way out
possibility is to purchase the DBM modified kernel from Sybase (the
database vendors). Not cheap, but gives you 256 fd's per process as a
side-effect.

regards,
        Martin Reed, Racal Imaging Systems Ltd
+----------------------------------------------------------+
|uucp: mr@ritd.co.uk, uunet!ukc!ritd!mr, sunuk!ritd!mr     | `Just hold
|Global String: +44 256 469943   Fax: +44 256 471492       |  these two
|Paper: Rankine Road, Basingstoke, Hants, England, RG24 0NW|  wires...'
+----------------------------------------------------------+

billq@cbnewsc.att.com (William Quayle) (07/22/89)

>From article <193@brazos.Rice.edu>, by meulenbr@cstw01.prl.philips.nl (Frans Meulenbroeks):
: Can someone tell me how I can extend the max. number of open files?  I've
: obtained a program which opens a lot of files, and I would prefer not to
: modify the program. 
: 
: Regards,
: Frans Meulenbroeks        (meulenbr@cst.prl.philips.nl)
: 	Centre for Software Technology
: 	( or try: ...!mcvax!phigate!prle!cst!meulenbr)

The max number of open files is compiled into the kernel, and is
determined using the "MAXUSERS" parameter in the configuration file.  We
bump MAXUSERS up to 32 on our clients with no ill effects, although this
was not possible in pre 3.5(?) releases of the SunOS.

In /usr/sys/conf.common/param.c, the MAXUSERS parameter is massaged into
providing relevent numbers for number of processes, open files, inodes,
and stream data structures.  According to Sun, these are all related
enough to be based on the "magic number."


DISCLAIMER: The material contained in this is the opinion only of the Author.

=========================================================
William R. Quayle       | ...!attmail!billq
M/S 2E-221              |
AT&T Bell Laboratories  |
2000 N Naperville Rd.   |
Naperville, Il. 60566   |    312-979-3137

sgf@cfm.brown.edu (William Quayle) (07/28/89)

billq@cbnewsc.att.com (William Quayle) writes:
>The max number of open files is compiled into the kernel, and is
>determined using the "MAXUSERS" parameter in the configuration file...

Well, the system maintains a set of structures describing open files, but
it refers to all open files on the system. The size of the set is
determined at build time by an arcane formula (in /usr/sys/conf/param.c in
SunOS 3.x) based on MAXUSERS from the conf file. If you need to increase
it muck around with the specific formula for it in param.c. Just
arbitrarily bumping up MAXUSERS can get you into other messes.

The problem that most people run into and complain about is the limit on
open files per process. In 3.3 it's 30 and in 4.x it's 64 and is called
"NOFILE" (found in /usr/include/sys/param.h). There are several grungy
things in the kernel that make changing this unpretty (eg, the way the
descripter is encoded in ioctl parameters passed to the kernel).

richard@torch.UUCP (Richard Nuttall) (07/28/89)

meulenbr@cstw01.prl.philips.nl (Frans Meulenbroeks) writes:

>Can someone tell me how I can extend the max. number of open files?  I've
>obtained a program which opens a lot of files, and I would prefer not to
>modify the program. 

One of the benefits of SunOS4.0 is that you can have more open files than
the usual 20.

Looking in /sys/sys/param.h on my Sun386 gives NOFILE (max number of open
files per process) to be 64.

If this still isn't enough, you could try changing this value and
rebuilding the kernel, though I take no responsibility for anything that
might happen as a result.

<#include "std_disclaimer.h">

Richard Nuttall               |    ukc!stc!datlog!torch!richard
Torch Technology Ltd.         |    richard@torch.co.uk
Cambridge England             |    0223 841000 X 308