[Date Prev][Date Next]
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. */
#define SHUT_RD SHUT_RD
SHUT_WR, /* No more transmissions. */
#define SHUT_WR SHUT_WR
SHUT_RDWR /* No more receptions or transmissions. */
#define SHUT_RDWR SHUT_RDWR
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 )
# if SHUT_RDWR
# 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 :
# ifdef SHUT_RDWR
# if SHUT_RDWR
and so slapd make a shutdown() before calling close().
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.