-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Describe the bug
When running OpenVPN 2.7.0 on Ubuntu 24.04 and configuring a single OpenVPN instance to listen on both TCP and UDP on the same port (8443) using:
local * 8443 tcp
local * 8443 udp
the initial connection establishment becomes extremely slow under load (approximately 400–500 concurrent clients). TLS handshake and session establishment can take 30+ seconds. Post-connection latency is also noticeably increased.
If TCP and UDP are handled by separate OpenVPN instances (each bound to port 8443 but only one protocol per instance), the issue does not occur. In that setup, connection establishment is immediate and latency remains stable under the same load.
The server has sufficient CPU, memory, and network capacity. No resource exhaustion or networking anomalies are observed at the OS level. OpenVPN logs (with verb 0) do not show warnings or errors during the issue.
This setup also uses deferred authentication via auth-script-openvpn:
https://github.com/fac/auth-script-openvpn
To Reproduce
Install OpenVPN 2.7.0 on Ubuntu 24.04.
Configure a single OpenVPN server instance to listen on both TCP and UDP on the same port:
local * 8443 tcp
local * 8443 udp
Enable deferred authentication using:
https://github.com/fac/auth-script-openvpn
Generate load with approximately 400–500 concurrent clients connecting.
Observe connection establishment time and latency.
Expected behavior
Connection establishment should remain fast and consistent under load, similar to when TCP and UDP are handled by separate OpenVPN instances.
There should be no significant degradation in initial handshake time or post-connection latency simply due to serving both protocols from a single instance on the same port.
Version information
OS: Ubuntu 24.04
OpenVPN version: 2.7.0
Clients: Mixed TCP and UDP clients (same server port 8443)
Additional context
The issue is reproducible only when both TCP and UDP are served by the same OpenVPN instance on the same port.
When splitting into two separate OpenVPN processes (one TCP-only, one UDP-only), performance is stable under identical load.
The server is not CPU-bound, memory-bound, or I/O-bound during the issue.
No relevant warnings or errors appear in openvpn.log at verb 0.