[lkml]   [2001]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Should __FD_SETSIZE still be set to 1024 ?
On Fri, Jun 22, 2001 at 06:25:41PM +0200, Dag Wieers wrote:

So if someone wants to increase it for an application he needs to
be sure that everything that it is linked with is compiled with a
similar __FD_SETSIZE ?

Well... only things that care about __FD_SETSIZE :)

Why can you safely increase the value in Squid then ?

Because it has been tested and works. I assume libc doesn't care is
this value is increased, not sure about other libraries.

Using libc5 and linux 2.1.9x + scts large-fd patch (which got merged
in later kernels), I manged to work with 100K FDs without too many

The defintion of 'fd_set' changes with __FD_SETSIZE, so anything
makes these kind of assumptions might break.

For example, if you have some code which assumes this is 1024 and you
try to copy a value into a preallocated array of structure it
defined, then it will break.

So will precompiled code such as:

struct cookie {
int type;
fd_set chocolate_feeds;
int cc_count;

sort of thing; because fd_set's size will be wrong.

Yes, but still, why 1024 ?

Because thats what is has been for a very long time, a safe default.

If your application knows better, it can change it.

No, squid takes the lowest of both (FD_SETSIZE and SQUID_MAXFD)
in main.c. And the Squid configure gets the FD_SETSIZE value
from linux/posix_types.h ;(

Really? I though for the last couple of years squid would use poll
over select anyhow?

I'm still not convinced that something might break, since everybody
advices to increase __FD_SETSIZE before compiling Squid.

So do it then.

And if linux/posix_types.h defines the limit of open file
descriptors of the system, 1024 is (IMO) a wrong number. But then
again, nobody bothered to change it...

Because 1024 works everywhere, a large or smaller value might not.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:55    [W:0.044 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site