[squid-users] FD_SETSIZE and max open filedescriptors

From: Chris McDonough <[email protected]>
Date: Thu, 03 Jan 2002 11:50:28 -0500

Hi folks,

I'm using Squid 2.4-STABLE3 on Linux 2.4.X, and it appears that the only
way I can convince Squid to start with more than 1024 file descriptors
(even if bash's ulimit -n reports, for example, 30000 at compilation
time and runtime -- I'm dead certain that the OS and the shell limits
are set high enough) is to bruce-force set the number in main.c like so:

*** main.c Tue Dec 25 07:38:51 2001
--- main-new.c Wed Jan 2 21:26:41 2002
***************
*** 575,580 ****
--- 575,581 ----
       debug_log = stderr;
- if (FD_SETSIZE < Squid_MaxFD)
-
Squid_MaxFD = FD_SETSIZE;
+ Squid_MaxFD = 30000;

   #if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)
       if ((WIN32_init_err = WIN32_Subsystem_Init()))

Note that this diff is against CVS HEAD, but the results are the same
with 2.4-STABLE3. This works fine, or at least appears to under very
heavy load.

I don't really want to do this to main.c (for distribution purposes), so
I've tried instead to force the define of src/squid.h's
CHANGE_FD_SETSIZE to 1 (despite the dire warning as regards Linux)
before a compilation but it seems to have no effect. After compiled
this way (and running in a shell that has 30000 max open fds) Squid
still starts with 1024 FDs available according to cache.log. Note that
I *do* see configure report the max number of open filedescriptors as
30000 (as opposed to the Linux default of 1024). It also reports
FD_SETSIZE as 1024.

Has anyone else encountered this problem?

- C
Received on Thu Jan 03 2002 - 09:34:04 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:05:37 MST