Subject: Too Many Open Files
To: None <current-users@NetBSD.ORG>
From: Rick Byers <>
List: current-users
Date: 05/26/1997 17:20:34
I'm not sure if this is entirely netbsd related or not, but I'm beginning
to think it must be.  I'm running Apache 1.1.3 on NetBSD 1.2.1, and the
error_log is full of "too many open files" errors from socket() calls.
I've set the max open files to unlimited before starting apache:
(ulimit -n unlimited ; /local/etc/httpd/httpd)
and a getrlimit inside apache confirms that the open file limit is equal
to the max open files in the system (6000 - we're not using more than 2000
most of the time).  I even put a setrlimit inside of apache.

Is there any conditions in which the open files limit will be reduced
(switching users to nobody for example, or forking a child)?  There are no
setrlimits inside of apache that lower the file limit. Is there any other
condition other than the resource limit that socket will return too many
open files?  

There isn't any way to get the resource limits for a process other than
the current process, is there?  I didn't notice this happening before I
upgraded from 1.2 to 1.2.1.

I'm going to try to add some extra debugging/logging in apache, but
in the meantime, Thanks for any suggestions.  

Rick Byers                                      Internet Access Worldwide                                System Admin, Tech Support
Welland, Ontario, Canada                                    (905)714-1400