From 0e7866cb719fb973b40c3ea53c3f7fb04a1728d6 Mon Sep 17 00:00:00 2001 From: hybtoy Date: Wed, 9 May 2018 09:33:12 +0500 Subject: [PATCH] TCP_NODELAY Add tcp_nodelay option for proto tcp --tcp-nodelay This macro sets the TCP_NODELAY socket flag on the server as well as pushes it to connecting clients. The TCP_NODELAY flag disables the Nagle algorithm on TCP sockets causing packets to be transmitted immediately with low latency, rather than waiting a short period of time in order to aggregate several packets into a larger containing packet. In VPN applications over TCP, TCP_NODELAY is generally a good latency optimization. --- openvpn-install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openvpn-install.sh b/openvpn-install.sh index 49adb4a..3983cc4 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -689,6 +689,8 @@ WantedBy=multi-user.target" > /etc/systemd/system/iptables.service echo "proto udp" >> /etc/openvpn/server.conf elif [[ "$PROTOCOL" = '2' ]]; then echo "proto tcp" >> /etc/openvpn/server.conf + echo "socket-flags TCP_NODELAY" >> /etc/openvpn/server.conf + echo "push "socket-flags TCP_NODELAY"" >> /etc/openvpn/server.conf fi echo "dev tun user nobody