Elusive Kernel Parameter

Elusive Kernel Parameter

Post by Steve Grocot » Wed, 28 Apr 1999 04:00:00



Hi All,

I've got users whose programs are trying to open one-too-many files.
I've been assuming that there's a kernel parameter somewhere that needs
to be set (like
maxfiles and nfiles on an HP) but I sure can't find it. Does anyone know
what parameter I'm looking for?

TIA,

Steve

--
______________________________________________________________________
                                  |
Steve Grocott                     | We are confronted with
Macan Computing Services          |   insurmountable opportunities

603.622.8115                      |
http://www.macan.com              |
______________________________________________________________________

 
 
 

Elusive Kernel Parameter

Post by Tim Campbel » Wed, 28 Apr 1999 04:00:00



> Hi All,

> I've got users whose programs are trying to open one-too-many files.
> I've been assuming that there's a kernel parameter somewhere that needs
> to be set (like
> maxfiles and nfiles on an HP) but I sure can't find it. Does anyone know
> what parameter I'm looking for?

Ok - there are two divergent schools of thought on this.

The easy way to get around the problem one time is the "ulimit" command.
Type "ulimit -a" to see everything, but you're just interested in "ulimit
-n" which is the number of file-descriptors (the number of simultaneous
files which may be opened at any one time by a SINGLE process.

You can bump this up to something more reasonable. In fact if you run a web
server, you SHOULD bump this number up to somethink like 512 or maybe even
1024 as it's quite probable that your web server will, at some point, need
to open more than 64 files at once.

When you adjust ulimit, it applies only to the shell in which you applied
the command, and it's children.  So if you type "ulimit -n 256" and then
start a Netscape web server (from that same shell), then the web server
(being a child of the shell) will be allowed to open 256 files at a time.

Some webmasters will incorporate this into their web server's start
scripts.

Followers of the other school of thought will modify /etc/system by
inserting a line which reads "set rlim_fd_max=1024".   The system will only
read this on bootup, but most things can be changed in the kernal
dynamically using adb (it's only about 3 or 4 adb commands, but we wont go
into that now).

Now... here's the argument:

The first school of though argues that the second is wreckless and that you
should ONLY change settings like this for the process that you KNOW in fact
needs the change.  Changing the setting globally in the kernal can break
other programs.

This argument is not without merit. Netscape claims that if you raise the
limit to something higher than 1024, their web server will be fine, but
their directory server will break. So there's at least one program that
would be negatively impacted and probably a lot more. Ironically, even
though this troubled program comes from Netscape, their docs tell you edit
the system-wide default (at least that's the example they give). <sigh>

Regards
Tim

--
---------------------------------------------------

  "Very funny Scotty... now beam down my clothes"
---------------------------------------------------