[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: tcp_close and SHUT_RDWR, too many opened sockets

thank you for your help, but what do you think about the beginning of my message: is this a bug in source code?

SHUT_RDWR is defined and non null in /usr/include/sys/socket.h:
SHUT_RD = 0, /* No more receptions. */
SHUT_WR, /* No more transmissions. */
SHUT_RDWR /* No more receptions or transmissions. */
but in openldap-2.15/include/ac/socket.h you have:
# define tcp_read( s, buf, len) read( s, buf, len )
# define tcp_write( s, buf, len) write( s, buf, len )
# define tcp_close( s ) (shutdown( s, SHUT_RDWR ), close( s ))
# define tcp_close( s ) close( s )
and it's like SHUT_DOWN was null!! (I can't understand why), so I'm obliged to modify openldap-2.15/include/ac/socket.h :
I put
# ifdef SHUT_RDWR
instead of
and so slapd make a shutdown() before calling close().

best regards,

lise Didillon

At 10:37 20/06/02 -0700, you wrote:
At 07:36 AM 2002-06-19, Lise Didillon wrote:
>I do that because we got many and many connection in FIN_WAIT or CLOSE_WAIT state. Now it's a little better. But maby have you some idea to reduce the number of opened socket or how to close them immediately when you close a connection in slapd.
>the problem arrives for us because of the system limit for file descriptor.

There are three things you can look into:
1) setting an idle timeout in slapd.conf(5)
2) raising the number of file descriptors available to slapd(8)
3) tuning the kernel to close TCP streams more quickly.