[Openvpn-devel] Linux: do not change --txqueuelen OS default if not configured.

Message ID 20200629180405.17671-1-gert@greenie.muc.de
State Accepted
Headers show
Series
  • [Openvpn-devel] Linux: do not change --txqueuelen OS default if not configured.
Related show

Commit Message

Gert Doering June 29, 2020, 6:04 p.m.
Remove default setting of "set txqueuelen to 100".  This default dates
back to the "pre git" times (before 2005) and might have been beneficial
back then - nowadays, the Linux default is 500, and thus reducing(!)
txqueuelen by-default can cause TX packet drops on the tun interface,
and that's bad for throughput.

This is a similar change to commit f0b64e5dc (remove setting of the
socket send/receive buffers by default) - similar vintage of the
existing code, similar motivation.

Note: buffer length can be checked with "ip link show" (qlen NNN)

See also:
  https://ivanvari.com/solving-openvpn-poor-throughput-and-packet-loss/

Signed-off-by: Gert Doering <gert@greenie.muc.de>
---
 src/openvpn/options.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Arne Schwabe June 29, 2020, 8:39 p.m. | #1
Am 29.06.20 um 20:04 schrieb Gert Doering:
> Remove default setting of "set txqueuelen to 100".  This default dates
> back to the "pre git" times (before 2005) and might have been beneficial
> back then - nowadays, the Linux default is 500, and thus reducing(!)
> txqueuelen by-default can cause TX packet drops on the tun interface,
> and that's bad for throughput.
> 
> This is a similar change to commit f0b64e5dc (remove setting of the
> socket send/receive buffers by default) - similar vintage of the
> existing code, similar motivation.
> 
> Note: buffer length can be checked with "ip link show" (qlen NNN)
> 

Acked-By: Arne Schwabe <arne@rfc2549.org>
Gert Doering June 29, 2020, 8:54 p.m. | #2
Patch has been applied to the master branch.

(I claim to have tested this before sending to the list :-) )

commit 3ef858b3d63c61be2f473a8dc5f1f79fa09a85d8
Author: Gert Doering
Date:   Mon Jun 29 20:04:05 2020 +0200

     Linux: do not change --txqueuelen OS default if not configured.

     Signed-off-by: Gert Doering <gert@greenie.muc.de>
     Acked-by: Arne Schwabe <arne@rfc2549.org>
     Message-Id: <20200629180405.17671-1-gert@greenie.muc.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg20160.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index c21ef56d..a40efd68 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -840,9 +840,6 @@  init_options(struct options *o, const bool init_gc)
 #ifdef ENABLE_FEATURE_TUN_PERSIST
     o->persist_mode = 1;
 #endif
-#ifdef TARGET_LINUX
-    o->tuntap_options.txqueuelen = 100;
-#endif
 #ifdef _WIN32
 #if 0
     o->tuntap_options.ip_win32_type = IPW32_SET_ADAPTIVE;