SUMMARY: Apache 1.3.12 & Tru64 5.0

From: Dawn Lovell <dlovell_at_cte.net>
Date: Tue, 28 Mar 2000 15:41:20 -0600 (CST)

My original post can be found at the end of this message.

Thanks to Steve VanDevender, John P. Speno, and Joerg Bruehe for
their responses!

While the original problem still exists, I do have a workaround now.
When converting to shared access and error logs for the virtual sites,
I had still specified the TransferLog and ErrorLog entries individually
for each VirtualHost. That caused the number of file descriptors
to stay the same even though the file names were identical. Removing
the individual TransferLog and ErrorLog entries does clear the file
descriptor error.

I'm still concerned why this machine (DS10, Tru64 5.0, Apache 1.3.12)
is receiving the file descriptor error, while the machine from which
the Apache config was copied (Alpha 1000, Tru64 4.0d, Apache 1.3.4)
is not. The source machine does specify individual access logs for each
virtual site.

It was suggested to use lsof and some type of trace or truss equivalent
to track down which files were being opened and at what point the error
was generated. I downloaded alpha-trace from the following site,
httpd: ftp://ftp.iastate.edu/pub/unix/digital_unix/trace/, and ran it
on the httpd process.

Not being a C programmer is working against me here. :-) If I'm
interpreting this correctly, it looks like the process errors when trying
to open the 64th file descriptor? Below is the trace output from just
before the error.

[482198]: open ("/usr/local/apache/logs/virtual/site24", O_WRONLY|O_CREAT
|O_APPEND, 644) = 5
[482198]: fcntl (5, F_DUPFD, 15) = 62
[482198]: close (5) = 0
[482198]: open ("/usr/local/apache/logs/virtual/site25", O_WRONLY|O_CREAT|
O_APPEND, 644) = 5
[482198]: fcntl (5, F_DUPFD, 15) = 63
[482198]: close (5) = 0
[482198]: open ("/usr/local/apache/logs/virtual/site26", O_WRONLY|O_CREAT|O
_APPEND, 644) = 5
[482198]: fcntl (5, F_DUPFD, 15) = -1, Errno 24 (Too many open files)

There are quite a few getrlimit calls in the output; it appears (?) that
Apache is seeing the 4096 limit.

[482198]: getrlimit ( RLIMIT_NOFILE, 0x11fff9ca8 ) = 0 [ , {4096,4096} ]
[482198]: getrlimit ( RLIMIT_NOFILE, 0x11fff9ca8 ) = 0 [ , {4096,4096} ]

In getting over my head, it looks like errno 24 is EMFILE (from errno.h),
and the getrlimit/setrlimit man page says that is the error that will
be generated when a function attempts "to create new file descriptors
when the maximum hard limit has been reached..."

On the flip side, the lsof output shows Apache with file descriptors
numbered up to 230, which pretty closely matches the number of files
I would expect it to have open (with individual TransferLogs for each
virtual site). Those bulk of the descriptors in the lsof output are
associated with virtual site logfiles.

The only compilation options given to Apache were the installation
prefix and a CFLAGS setting of "-DDYNAMIC_MODULE_LIMIT=0". I've tried
rebuilding it with both gcc 2.95.2 and the cc that comes with the OS.
I've tried both without the CFLAGS setting.

If anyone has any further suggestions, I would really appreciate your
help. I'm hoping for something obvious that I should have already
found. :-) Thanks for your time!

Dawn Lovell
dlovell_at_cte.net

--- Original message ---

>I know this is one of the most FAQ in history, but I'm evidently missing
>something obvious.
>
>When starting Apache 1.3.12 on my Tru64 5.0 (DS10) box, I receive the
>following error:
>
>[Mon Mar 27 10:19:14 2000] [warn] (24)Too many open files: unable to
>open a file descriptor above 15, you may need to increase the number
>of descriptors
>
>The value of maxusers on this system is 2048. Values for open_max_soft
>and open_max_hard are both 4096. I've tried starting httpd with a
>wrapper that sets ulimit -n 2048, but still receive the same error.
>
>Our Apache configuration contains 220 virtual hosts, which share a
>transfer and error log (i.e., two logfiles total for the virtual hosts).
>We have 253 aliases specified in /etc/inet.local, and one IP each on
>the two NICs. The aliases are all on the second NIC (tu1); only one IP
>is on the first (tu0). We are NFS-mounting the data directories that
>the web server will be displaying.
>
>I know the Apache file descriptor documentation (which is at
>http://www.apache.org/docs/misc/descriptors.html) mentions library
>limitations that may cause problems with greater than 256 descriptors.
>I would think this our problem, but we are copying this configuration
>from an Alpha 1000 (4.0D w/Apache 1.3.4) on which it runs without errors.
>The older system has more aliased IPs (384) and only one NIC, in case
>that makes a difference. Maxusers is 512 on the older system.
>
>Experimenting with the number of virtual hosts I can run before getting
>the error has shown that 45 is my limit. Another oddity (to me) is that
>45 is my limit with the virtual hosts having two shared logs (transfer
>& error) or with them logging to separate files. It would seem that
>I should have more descriptors available with the shared logging, but
>that doesn't appear to be the case.
>
>Would someone point me in the right direction on this? Please feel free
>to smack me in the face with its obviousness. :-) Thanks for your help!
>
>Dawn Lovell
>dlovell_at_cte.net
>
Received on Tue Mar 28 2000 - 21:38:12 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:40 NZDT