aboutsummaryrefslogtreecommitdiff
path: root/src/openvpn/socket.c
diff options
context:
space:
mode:
authorGert Doering2019-08-15 17:53:19 +0200
committerGert Doering2019-08-16 20:09:14 +0200
commit6d8380c78bf77766454b93b49ab2ebf713b0be48 (patch)
tree8865402c27262b3c10b68ca32fc8ed0ea8b94a1f /src/openvpn/socket.c
parent8a05f860af386cd135ee1aacb0d5eccc49c466bb (diff)
downloadopenvpn-6d8380c78bf77766454b93b49ab2ebf713b0be48.zip
openvpn-6d8380c78bf77766454b93b49ab2ebf713b0be48.tar.gz
Increase listen() backlog queue to 32
For reasons historically unknown, OpenVPN sets the listen() backlog queue to "1", which signals the kernel "while there is one TCP connect waiting for OpenVPN to handle it, refuse all others" - which, on restarting a busy TCP server, will create connection issues. The exact "best" value of the backlog queue is subject of discussion, but for a server that is not extremely busy with many connections coming in in parallel, there is no real difference between "10" or "500", as long as it's "more than 1". Found and debugged by "mjo" in Trac. Trac: #1208 Signed-off-by: Gert Doering <gert@greenie.muc.de> Acked-by: Antonio Quartulli <antonio@openvpn.net> Acked-by: David Sommerseth <davids@openvpn.net> Message-Id: <20190815155319.28249-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg18758.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'src/openvpn/socket.c')
-rw-r--r--src/openvpn/socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c
index c472cf1..983ed38 100644
--- a/src/openvpn/socket.c
+++ b/src/openvpn/socket.c
@@ -1175,7 +1175,7 @@ socket_do_listen(socket_descriptor_t sd,
ASSERT(local);
msg(M_INFO, "Listening for incoming TCP connection on %s",
print_sockaddr(local->ai_addr, &gc));
- if (listen(sd, 1))
+ if (listen(sd, 32))
{
msg(M_ERR, "TCP: listen() failed");
}