Re: Out of filedescriptors

From: Jonathan Larmour <>
Date: Fri, 22 Nov 1996 13:40:02 +0000

At 12:04 22/11/96 +0000, Nigel Metheringham wrote:
>} > Does anyone has experiance in how to increase the maximum number of
>} > open filedescriptors from 256 to 2048. I know this has to be some changes
>} > in kernel sources and recompilation.
>For a 2.0.x kernel it can be changed by modding the sysctl file in
>you should just be able to do
> echo 2048 >/proc/sys/kernel/file-max
>and there should be no need for a recompile.

Sorry. In fact this increases the total number of file descriptors allowed
on the machine. The _per-process_ number i.e. NR_OPEN stays the same.

>However the libraries need to allocate a large enough structure for fdset
>- which *could* be done by having you allocating a bigger chunk and
>casting it to an fdset without hacking your include files... and using the
>right values in the select call.

This only matters when NR_OPEN changes to be greater than FDSET_SIZE

Apparently (I have been told) select adjusts automatically. Perhaps it uses
getrlimit() the first time it is called, and remembers it as NR_OPEN can't
be changed on the fly.I don't have the libc source so I can't say. Oskar
describes how to increase NR_OPEN nicely.

Assuming the list got my previous message on the subject, then if you look
back at it, as I said there is a problem on linux that squid is marking too
many fd's as reserved (and gets the total number wrong too), as it assumes
FDSET_SIZE==NR_OPEN. This should be fixed.

Jonathan L.
Origin IT Services Ltd., 323 Cambridge Science Park, Cambridge, England.
Tel: +44 (1223) 423355 Fax: +44 (1223) 420724 E-mail: guess...
-------[ Do not think that every sad-eyed woman has loved and lost... ]------
-----------------------[ she may have got him. -Anon ]-----------------------
These opinions are all my own fault.
Received on Fri Nov 22 1996 - 05:44:22 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:33:36 MST