Winbindd limited by select

Mike Sweet mike at easysw.com
Sat Feb 15 16:24:07 GMT 2003


Michael Steffens wrote:
> Mike Sweet wrote:
> 
>> Sooo, my recommendations are as follows:
>>
>>     1. Provide a configure option (--with-maxfiles or similar)
>>        to configure the upper limit you want to support in SAMBA.
>>     2. Provide a smb.conf option to control the max number of
>>        file descriptors.
>>     3. Provide a definition on Solaris for FD_SETSIZE before
>>        including <sys/select.h> so that the correct version of
>>        select() is used.
>>     4. On startup, query the current FD limit and set it to the
>>        smaller of the "maxfiles" definition, the max value
>>        reported by the kernel, and the max value in smb.conf.
>>     5. Allocate the fd_set buffers [(maxfiles + 7) / 8 bytes]
>>        and replace all use of FD_ZERO with memset/bzero with
>>        the correct size.
>>     6. Make sure all calls to FD_SET and FD_CLR are updated to
>>        not use "&set", since "set" is now allocated.
> 
> 
> Sounds good! And, for winbindd's client connections, shut down
> idle connections when the limit is about to be exceeded?

Right.  CUPS keeps track of the last activity for each client,
and shuts down inactive connections after a configurable amount of
time (30 seconds by default).

> Would need to also take FDs for TCP connections, TDBs, logs, etc
> into account.

For CUPS we limit the number of network connections to 1/3 of the
available file descriptors (to account for log files, pipes, IPP
and other data files, and job processing; I'm sure there are other
(more accurate) ways of tracking this, and for winbindd you'll likely
have different requirements...

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products                  mike at easysw.com
Printing Software for UNIX                       http://www.easysw.com



More information about the samba-technical mailing list