Re: File descriptors

From: Dancer <dancer@dont-contact.us>
Date: Fri, 16 Oct 1998 13:24:34 +1000

Irfan Akber wrote:
>
> I am using squid 1.1.22 on kernel 2.0.34. What are file descriptors and
> what effects will it have if there are less number of file descriptors. If
> I should increase them what do I need to do ?
>
> Irfan Akber

Explanation in bite-sized ideas:

File-descriptors are small data-structures that keep track of open files
and network connections. (* This is an oversimplification)

File-descriptors are maintained by the kernel.

There are two limits: (a) The total number willing to be handled by the
kernel for all processes (combined); (b) The maximum allowable for each
process.

The first limit can be changed in your kernel (it probably defaults to
1024) by executing the following command (as root): echo "NNNNN" >
/proc/sys/kernel/file-max
(Replace NNNNN with a number, say 8192 or 16384. Powers of two are
probably 'cooler' numbers to use than numbers that aren't)

The per-process limit can only be changed by patching the kernel, at the
present time. To get the patch, go to http://www.linux.org.za/patches/

No, I won't go into detailed instructions on how to apply the patch. All
that's needed is to RTFM (man patch), and exercise a modicum of
brain-power (and use --dry-run in conjunction with the other parameters
until you figure out how to stop it complaining)

When squid runs out of filedescriptors on a linux 2.0.xx system, the
results fall into one of two categories. If you just nudge the limit,
requests sit there, waiting, until squid has descriptors free to take
the load...service slows down. If you seriously head-butt the limit it
just stops working. The process sits there like a lump, but no more
requests get handled. You can get squid to start talking again with
'squid -k reconfigure'.

If you want to know how many file-descriptors are being used at any
given moment, read the documentation and release notes carefully (and
the FAQ, I daresay), and set up cachemgr.cgi on the same or another box,
and adjust your squid access controls to give it access. The
cache-information page will tell you how many are being used.

D
Received on Thu Oct 15 1998 - 21:01:56 MDT

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