Investigate and potentially add options for fast-io and sndbuf/rcvbuf tweaks to OpenVPN
Feedback from users suggests there is a great speed improvement to be had by using the following settings on certain platforms:
fast-io sndbuf 524288 rcvbuf 524288
fast-io is OK to use on FreeBSD, but is UDP-only so it would need to only be added then, and have the option hidden when using TCP modes.
--fast-io (Experimental) Optimize TUN/TAP/UDP I/O writes by avoiding a call to poll/epoll/select prior to the write operation. The purpose of such a call would normally be to block until the device or socket is ready to accept the write. Such blocking is unnecessary on some platforms which don't support write blocking on UDP sockets or TUN/TAP devices. In such cases, one can optimize the event loop by avoiding the poll/epoll/select call, improving CPU efficiency by 5% to 10%. This option can only be used on non-Windows systems, when --proto udp is specified, and when --shaper is NOT specified.
The buffer size above, 524288, appears to have been chosen either arbitrarily or based on settings found elsewhere. We could offer a drop-down based on the value of net.inet.tcp.sendbuf_max & net.inet.tcp.recvbuf_max or a free-form field with suggestions.
--sndbuf size Set the TCP/UDP socket send buffer size. Defaults to operation system default. --rcvbuf size Set the TCP/UDP socket receive buffer size. Defaults to operation system default.
Updated by Jim Pingle over 4 years ago
- Target version changed from 2.4.1 to 2.4.0
This seemed safe enough and reports of significant speed increases, especially on SG-1000, made this desirable for 2.4. It's all in now. Local testing shows it being good, but it could use wider testing.