9.5.0-P2 and socket: too many open file descriptors

Kevin Darcy kcd at chrysler.com
Wed Aug 13 21:47:27 UTC 2008


I believe FD_SETSIZE is the OS-defined value and your -DFD_SETSIZE=8192 
is probably being re-defined/overridden by a system header file.

ISC_SOCKET_FDSETSIZE is the BIND-specific setting, and will supercede 
FD_SETSIZE if it's larger:

#if ISC_SOCKET_FDSETSIZE > FD_SETSIZE
        manager->fdsize = ISC_SOCKET_FDSETSIZE;
        manager->fd_bufsize = howmany(ISC_SOCKET_FDSETSIZE, NFDBITS) *
                sizeof(fd_mask);
#else
        manager->fdsize = FD_SETSIZE;
        manager->fd_bufsize = sizeof(fd_set);
#endif

Note the comment block starting at line 72 of that source file.

                                                                         
         - Kevin

David Sparks wrote:
>> Apparently 16384 fd isn't sufficient?  I restarted named and:
>>     
>
>   
>> I doubt it ran out of fds ... either I compiled it wrong or there is something 
>> else going on.
>>     
>
> To answer my own question I recompiled named with some diagnostics and find 
> out that 1024 is still the FD limit:
>
> 13-Aug-2008 14:07:03.480 general: error: too many open file descriptors: 1024
>
> I followed the example and ran configure like this:
>
> STD_CDEFINES='-DFD_SETSIZE=8192' ./configure
>
> and found this in the log:
>
> config.log:STD_CDEFINES='-DFD_SETSIZE=8192'
>
> What am I doing wrong?
>
> Thanks,
>
> ds
>
>
> diff -ur bind-9.5.0-P2/lib/isc/unix/socket.c 
> bind-9.5.0-P2.new/lib/isc/unix/socket.c
> --- bind-9.5.0-P2/lib/isc/unix/socket.c 2008-07-28 21:47:09.000000000 -0700
> +++ bind-9.5.0-P2.new/lib/isc/unix/socket.c     2008-08-13 12:44:09.805793341 
> -0700
> @@ -1559,7 +1559,7 @@
>                                 ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
>                                 isc_msgcat, ISC_MSGSET_SOCKET,
>                                 ISC_MSG_TOOMANYFDS,
> -                              "%s: too many open file descriptors", "socket");
> +                              "too many open file descriptors: %d", sock->fd);
>                  free_socket(&sock);
>                  return (ISC_R_NORESOURCES);
>          }
> @@ -2131,7 +2131,7 @@
>                                         ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
>                                         isc_msgcat, ISC_MSGSET_SOCKET,
>                                         ISC_MSG_TOOMANYFDS,
> -                                      "%s: too many open file descriptors",
> +                                      "too many open file descriptors: %d", 
> sock->fd,
>                                         err);
>                          goto soft_error;
>
> @@ -2190,7 +2190,7 @@
>                                         ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
>                                         isc_msgcat, ISC_MSGSET_SOCKET,
>                                         ISC_MSG_TOOMANYFDS,
> -                                      "%s: too many open file descriptors",
> +                                      "too many open file descriptors: %d", 
> sock->fd,
>                                         "accept");
>                          (void)close(fd);
>                          goto soft_error;
>
>
>
>   



More information about the bind-users mailing list