home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!auspex-gw!guy
- From: guy@Auspex.COM (Guy Harris)
- Newsgroups: comp.sys.sun.admin
- Subject: Re: per-process descriptor table sizes?
- Message-ID: <14635@auspex-gw.auspex.com>
- Date: 15 Sep 92 01:33:05 GMT
- References: <BuLByM.JII@usenet.ucs.indiana.edu>
- Sender: news@auspex-gw.auspex.com
- Organization: Auspex Systems, Santa Clara
- Lines: 76
- Nntp-Posting-Host: bootme.auspex.com
-
- (If anybody's gathering up postings for inclusion in an FAQ some day -
- there isn't an FAQ for any of the "comp.sys.sun" groups - this is one
- that belongs there.)
-
- >On a Sparc II running SunOS 4.1.2, how does one increase the
- >per-process descriptor table size? The default is 64.
- >
- >In param.h, NOFILE is defined to be 256, so I doubt it's that
- >value despite the comment that indicates so.
-
- Well, the *hard* limit *is* 256.
-
- >In user.h,
- >changing NOFILE_IN_U from 64 to 128 and rebuilding the kernel
- >has had no effect.
-
- It wouldn't have an effect unless you recompiled those source files that
- use the U area table of file descriptors, and if you do that, you have
- to compile every *other* kernel source file that uses the U area, *and*
- any user-mode code that knows the shape of the U area.
-
- (I.e., changing an arbitrary parameter in a header file and rebuilding
- your kernel doesn't work, unless you have full source or happen to be
- lucky enough to have changed a parameter that's used only by files for
- which you get source in a standard distribution.)
-
- The *soft* limit is 64.
-
- From the use of "hard" and "soft", you may suspect that this is a
- resource limit, just like the core dump size, the file size, etc.
-
- You'd be correct in so suspecting; in SunOS 4.1[.x] and SunOS 5.0 (hell,
- in *any* SVR4 release worthy of the name), the file table size is a
- resource limit.
-
- As such, you change it with:
-
- the "limit" command in the C shell;
-
- the "ulimit" command in the Bourne or Korn shells *IF* you have
- a Bourne or Korn shell with a "ulimit" command that provides
- access to those limits - the Bourne shell that comes with SunOS
- 4.1[.x], and probably most Korn shells built for 4.1[.x], don't,
- but the Bourne and Korn shells that come with SVR4 do;
-
- the "getrlimit()" and "setrlimit()" calls in a C program.
-
- For example:
-
- auspex% limit
- cputime unlimited
- filesize unlimited
- datasize 524280 kbytes
- stacksize 8192 kbytes
- coredumpsize unlimited
- memoryuse unlimited
- descriptors 64
- auspex% limit descriptors 256
- auspex% limit
- cputime unlimited
- filesize unlimited
- datasize 524280 kbytes
- stacksize 8192 kbytes
- coredumpsize unlimited
- memoryuse unlimited
- descriptors 256
-
- If you have a program that should *always* have the limit cranked up, do
- the "getrlimit()" and "setrlimit()" calls within the program, or run the
- program within a C shell wrapper.
-
- You can't raise the hard limit, at least in SunOS 4.1[.x]. It's stuck
- at 256 (unless, I think, you have Sun's Database Excelerator, or
- whatever the heck they call it, in which case I think it's cranked up to
- 1024). You may be able to crank the hard limit past the default of 1024
- in SVR4, or at least in the SunOS 5.0 version of SVR4.
-