[comp.unix.wizards] Out of descriptors, out of luck?

rds@ECLU.psu.edu (R. David Singh) (04/14/91)

Hmm, does anyone know of a way to increase the tablesize of file descriptors
available to a process.  getdtablesize() gives me 60 (which just won't cut it)
and my program is barfing up fragments.  E-mail responses are preferred.

mike@bria.UUCP (Michael Stefanik) (04/15/91)

In an article, rds@ECLU.psu.edu (R. David Singh) writes:
>Hmm, does anyone know of a way to increase the tablesize of file descriptors
>available to a process.  getdtablesize() gives me 60 (which just won't cut it)
>and my program is barfing up fragments.

Please.  This is hardly a wizardly question.  Go RTFM on how to configure
and relink your kernel.
-- 
Michael Stefanik, MGI Inc, Los Angeles | Opinions stated are never realistic
Title of the week: Systems Engineer    | UUCP: ...!uunet!bria!mike
-------------------------------------------------------------------------------
If MS-DOS didn't exist, who would UNIX programmers have to make fun of?

guy@auspex.auspex.com (Guy Harris) (04/16/91)

>Please.  This is hardly a wizardly question.  Go RTFM on how to configure
>and relink your kernel.

TFM may say "sorry, you can't do that".  Different systems set that
table size in different ways; some require source to reconfigure.  Other
systems may have, say, a "soft" limit of 64 and a "hard" limit of 256,
in which case the user should check out GETRLIMIT(2) and see how to
raise the soft limit to the hard limit.  (If you have RLIMIT_NOFILE,
that's the limit to raise; otherwise, you may be stuck.)

gwyn@smoke.brl.mil (Doug Gwyn) (04/16/91)

In article <195@bria.UUCP> uunet!bria!mike writes:
-In an article, rds@ECLU.psu.edu (R. David Singh) writes:
->Hmm, does anyone know of a way to increase the tablesize of file descriptors
->available to a process.  getdtablesize() gives me 60 (which just won't cut it)
->and my program is barfing up fragments.
-Please.  This is hardly a wizardly question.  Go RTFM on how to configure
-and relink your kernel.

And that's hardly a wizardly answer!

fkittred@bbn.com (Fletcher Kittredge) (04/18/91)

In article <195@bria.UUCP> uunet!bria!mike writes:
>In an article, rds@ECLU.psu.edu (R. David Singh) writes:
>>Hmm, does anyone know of a way to increase the tablesize of file descriptors
>>available to a process.  getdtablesize() gives me 60 (which just won't cut it)
>>and my program is barfing up fragments.
>
>Please.  This is hardly a wizardly question.  Go RTFM on how to configure
>and relink your kernel.

Far be it for me to question the quick response of a wizard such as yourself,
but isn't this a ignorant answer to a good question?  I would think a
real wizard would say that there are two ways to do this.  Reconfiguring
the kernel is inappropriate in most cases.  Many modern Unix systems support
the setrlimit().  If the man page for setrlimit() says that it supports
RLIMIT_NOFILE, then you can up the limit for the number of open files. Sun
O/S >=4.0 and HP-UX >=8.0 are examples of two operating systems which support
this facility.  See setrlimit() for details, if you have a POSIX.1 compliant
system, then sysconf() would also be of interest.

fletcher
Fletcher Kittredge
Senior Engineer, BBN Software Products
150 CambridgePark Dr,  Cambridge, MA. 02140
617-873-3465  /  fkittred@bbn.com  /  fkittred@das.harvard.edu

mike_s@EBay.Sun.COM (Mike "The Claw" Sullivan) (04/21/91)

In <63777@bbn.BBN.COM> fkittred@bbn.com (Fletcher Kittredge) writes:

>If the man page for setrlimit() says that it supports
>RLIMIT_NOFILE, then you can up the limit for the number of open files. Sun
>O/S >=4.0 and HP-UX >=8.0 are examples of two operating systems which support
>this facility.  

Slight correction. I believe that RLIMIT_NOFILE first appeared in SunOS 4.1,
not 4.0.

	Mike
--
Mike Sullivan                     Internet:   Mike.Sullivan@EBay.Sun.COM
Sun Education                     UUCP:       ..!sun!yavin!mike_s
Software Course Developer         Compuserve: 75365,764
       "I think they're trying to confuse us to death."

guy@auspex.auspex.com (Guy Harris) (04/21/91)

>Many modern Unix systems support the setrlimit().  If the man page for
>setrlimit() says that it supports RLIMIT_NOFILE, then you can up the
>limit for the number of open files. Sun O/S >=4.0 and HP-UX >=8.0 are
>examples of two operating systems which support this facility.

HP-UX >= 8.0 may be a UNIX flavor that supports RLIMIT_NOFILE, but SunOS
>= 4.0 and < 4.1 is *NOT* an example of such a system - that showed up
in 4.1, not in 4.0.

System V Release 4 is another example of a UNIX flavor that supports
RLIMIT_NOFILE.  It shouldn't be too surprising that SunOS 4.1 and S5R4
do that the same way; however, the fact that an organization not in the
S5R4 camp followed in Sun's and AT&T's footsteps, rather than inventing
something different but not better, is somewhat refreshing - perhaps
there's hope for the UNIX community yet. :-)

Note that you will probably only be able to raise the soft limit for
RLIMIT_NOFILE (which, at least in SunOS 4.1 and S5R4, specifies how many
new file descriptors you can get) to the hard limit; you may not be able
to affect the hard limit at all.