You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by James Richardson <ja...@db.com> on 2004/09/28 12:28:55 UTC

[users@httpd] File descriptor limit in Apache 2.0

Hi,

I have reached a limit on the number of open files, on my SuSE Linux
Apache 2 server.

Looking back at the mailing list archives, I see that by editing the
limits.conf file I can raise the limits above the normal 1024 to some
fairly arbitrary high value.

However, I cannot determine from this if I also need to recompile Apache
with an edited include file for FD_SETSIZE, or whether it will
automatically work. 

I understand that this is a limitation with select(), but am not clear
that the core apache module actually uses it, and that this _might_ only
be a problem in some, unspecified other, module.

I also understand that there may or may not be a problem with the logging
component of Apache as this may or may not require fds under 1024 to
operate correctly.

I would much appreciate it if anybody could shed some light on what I
might have to do to raise the limits, and end up with a usable system.

I am currently using, in addition to the normal set.

Mod_cache
Mod_disk_cache
Mod_proxy

Thanks for your help!

James Richardson


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] File descriptor limit in Apache 2.0

Posted by Bill Parker <do...@netnevada.net>.
----- Original Message ----- 
From: "James Richardson" <ja...@db.com>
To: <us...@httpd.apache.org>
Sent: Tuesday, September 28, 2004 3:28 AM
Subject: [users@httpd] File descriptor limit in Apache 2.0


>
> Hi,
>
> I have reached a limit on the number of open files, on my SuSE Linux
> Apache 2 server.
>
> Looking back at the mailing list archives, I see that by editing the
> limits.conf file I can raise the limits above the normal 1024 to some
> fairly arbitrary high value.

In some cases, the limits.conf file will get ignored (not sure why), but
what I usually do to increase open files
(since 1024 per process if you are a regular user can be quite low) is to
modify the linux kernel source to
give more open files on system startup (the file you need to modify is in
/usr/src/linux/include/linux and is
called 'fs.h', you want to set the NR_OPEN value (it's normally 1024) to
some higher value like 8192
(use a power of 2 here), and set the number of reserved files for root (it's
10) to say 128.  Save the
file, and compile away (i'd also change the value in Makefile on the
ExtraVersion line, so you don't
overwrite your working kernel and it's module set).

Always back up your working kernel and modules before doing modifications to
kernel source...

Bill


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] File descriptor limit in Apache 2.0

Posted by Joe Orton <jo...@redhat.com>.
On Tue, Sep 28, 2004 at 11:28:55AM +0100, James Richardson wrote:
> I have reached a limit on the number of open files, on my SuSE Linux
> Apache 2 server.
> 
> Looking back at the mailing list archives, I see that by editing the
> limits.conf file I can raise the limits above the normal 1024 to some
> fairly arbitrary high value.
> 
> However, I cannot determine from this if I also need to recompile Apache
> with an edited include file for FD_SETSIZE, or whether it will
> automatically work. 

With recent versions of Apache httpd 2.0 on Linux platforms, you do not
need to worry about FD_SETSIZE at all for the core code and bundled
modules, which do not directly use select() any more.

The FD_SETSIZE limit will still be a problem for any third-party modules
or libraries which use select(), notably current releases of PHP have
various nasty issues, and it can also be a problem with mod_ssl/OpenSSL
too.

> I understand that this is a limitation with select(), but am not clear
> that the core apache module actually uses it, and that this _might_ only
> be a problem in some, unspecified other, module.
> 
> I also understand that there may or may not be a problem with the logging
> component of Apache as this may or may not require fds under 1024 to
> operate correctly.

There shouldn't be any problems.

> I would much appreciate it if anybody could shed some light on what I
> might have to do to raise the limits, and end up with a usable system.
> 
> I am currently using, in addition to the normal set.
> 
> Mod_cache
> Mod_disk_cache
> Mod_proxy

These should all be OK.

joe

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org