Winbindd limited by select

MCCALL,DON (HP-USA,ex1) don_mccall at hp.com
Wed Feb 12 13:31:10 GMT 2003


On HP-UX 11.x, the default is 2048 for FD_SETSIZE.  You can also (according
to man page
for select()) handle this dynamically, if you are concerned for memory
footprint for 
your application.  An example from the man page:
 
      The user can also allocate the space for fd_set structure dynamically,
      depending upon the number of file descriptors to be tested. The
      following code segment illustrates the basic concepts.

                int num_of_fds,s;
                struct fd_set *f;

                /*
                 * Set num_of_fds to the required value.
                 * User can set it to the maximum possible value the kernel
is
                 * configured for, by using sysconf(_SC_OPEN_MAX).
                 * Note that, if you are not using these many files, you are
                 * wasting too much space.
                 */
                num_of_fds = sysconf(_SC_OPEN_MAX);
                s = sizeof(long);
                /*
                 * howmany is a macro defined in sys/types.h
                 */
                f = (struct fd_set *)malloc(s*howmany(num_of_fds, s*8);
                /*
                 * Use f wherever struct fd_set * is used.
                 * It can be used to test num_of_fds file descriptors.
		    */

So, might be a couple of ways to skin this cat :-)  (I don't mean literally,
for 
all you cat lovers out there!)
Don

> -----Original Message-----
> From: Ken Cross [mailto:kcross at nssolutions.com]
> Sent: Wednesday, February 12, 2003 7:36
> To: 'Multiple recipients of list SAMBA-TECHNICAL'
> Subject: Winbindd limited by select
> 
> 
> Samba-folk:
> 
> I've run into a problem with winbindd in both 2.2.x and 3.0 where it
> just locks up after a while on large, busy networks.
> 
> We finally tracked down the problem to the fact that the C library
> "select" function is limited by default to 256 file descriptors in
> NetBSD (1024 in FreeBSD, 2048 in Linux).  So once 256 (or 
> whatever) smbd
> processes connected to winbindd, it broke pretty badly and 
> was very hard
> to kill.
> 
> This is set at compile-time, not run-time.  This line:
> 
>  #define FD_SETSIZE 2048  /* Max # of winbindd connections */
> 
> must occur before the first invocation of <sys/types>.
> 
> This could be a build option, but it might be much simpler to 
> hard-code
> it in local.h, which is what I did to fix it.
> 
> Can somebody check the implications of this on Solaris, HPUX, etc.?
> 
> Thanks,
> Ken Cross
> Network Storage Solutions
> 


More information about the samba-technical mailing list