Re: Full file table FreeBSD 2.1R

From: Paul Southworth <pauls@dont-contact.us>
Date: Thu, 25 Jul 1996 19:41:50 -0400 (EDT)

On Fri, 26 Jul 1996, PETER STUBBS wrote:

:I've been running squid on my FBSD 2.1 system for quite some time
:now, and yesterday I hit my first real problem.
:
:The cache was getting quite a bit of work. About 3500 hits / hour and
:it started returning pages saying that it was busy, and / or out of
:file descriptors. Here's part of the /var/log/messages entry
:
:Jul 25 10:02:19 seraglio syslogd: /var/run/utmp: Too many open files
:in system
:Jul 25 10:03:35 seraglio /kernel: file: table is full
:
:I've rebuilt the kernel with
:options "CHILD_MAX=256"
:options "OPEN_MAX=256"

What does "pstat -T" say when you reach the file table limit? Most likely
the file table is full.

The OPEN_MAX and CHILD_MAX values do not control the total size of the
file table and process table.

Those are derived from the "maxusers" directive in your kernel
configuration file.

In /usr/src/sys/conf/param.c, you can alter the math behind that. By
default it looks like:

#define NPROC (20 + 16 * MAXUSERS)
int maxproc = NPROC; /* maximum # of processes */
int maxprocperuid = NPROC-1; /* maximum # of processes per user */
int maxfiles = NPROC*2; /* system wide open files limit */
int maxfilesperproc = NPROC*2; /* per-process open files limit */

So if MAXUSERS is 10 (as in GENERIC kernel), NPROC (maxproc) is 180 and
maxfiles (the thing you need to increase) is 360.

Your choices:

1. Increase MAXUSERS, or
2. Increase the NPROC multiplier for maxfiles so you get more. Such as:

int maxfiles = NPROC*4;

This same type of trivial kernel hack is possible on SunOS 4.x (see
/sys/conf.common/param.c -- it's almost identical). Most Berkeley systems
should be like this.

--Paul
Received on Thu Jul 25 1996 - 16:54:21 MDT

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