MXS-975: Remove hard limit on listen backlog

The listen() backlog is now set to INT_MAX which should guarantee that the
internal limit is always higher than the system limit. This means that the
length of the queue always follows /proc/sys/net/ipv4/tcp_max_syn_backlog.
This commit is contained in:
Markus Makela
2016-11-16 11:41:14 +02:00
parent a7c21eee88
commit b594bdc42a
2 changed files with 16 additions and 1 deletions

View File

@ -3497,7 +3497,14 @@ dcb_listen(DCB *listener, const char *config, const char *protocol_name)
return -1;
}
if (listen(listener_socket, 10 * SOMAXCONN) != 0)
/**
* The use of INT_MAX for backlog length in listen() allows the end-user to
* control the backlog length with the net.ipv4.tcp_max_syn_backlog kernel
* option since the parameter is silently truncated to the configured value.
*
* @see man 2 listen
*/
if (listen(listener_socket, INT_MAX) != 0)
{
char errbuf[STRERROR_BUFLEN];
MXS_ERROR("Failed to start listening on '%s' with protocol '%s': %d, %s",