Skip to content

tunnel: improve vpn performance - #193

Merged
pymq merged 4 commits into
masterfrom
tunnel-fix-perf
Jan 8, 2026
Merged

tunnel: improve vpn performance#193
pymq merged 4 commits into
masterfrom
tunnel-fix-perf

Conversation

@pymq

@pymq pymq commented Jan 8, 2026

Copy link
Copy Markdown
Member

See the individual commits for more details. This PR improves bandwidth for high-latency networks by 1.5-2x and reduces overall tunneling overhead, which should also improve peak bandwidth for low-latency networks as well (though this was not measured in the benchmarks).

Benchmark results for the simulated QUIC network with simnet. Manual testing produced similar results.

Before:

+-----------------------------+---------+-----------------+-------------------+-------------+-------------+
|          SCENARIO           | LATENCY | BANDWIDTH LIMIT | ACTUAL THROUGHPUT | UTILIZATION | PACKET LOSS |
+-----------------------------+---------+-----------------+-------------------+-------------+-------------+
| Fiber_200Mbps_1ms           | 1ms     | 200 Mbps        | 149.67 Mbps       | 74.83 %     | 99.55 %     |
| LongDistFiber_200Mbps_200ms | 200ms   | 200 Mbps        | 35.29 Mbps        | 17.65 %     | 99.91 %     |
| Fiber_100Mbps_1ms           | 1ms     | 100 Mbps        | 91.59 Mbps        | 91.59 %     | 99.78 %     |
| LongDistFiber_100Mbps_200ms | 200ms   | 100 Mbps        | 29.17 Mbps        | 29.17 %     | 99.94 %     |
| Cable_10Mbps_1ms            | 1ms     | 10 Mbps         | 9.73 Mbps         | 97.26 %     | 99.98 %     |
| Cable_10Mbps_10ms           | 10ms    | 10 Mbps         | 9.74 Mbps         | 97.36 %     | 99.98 %     |
| Cable_10Mbps_100ms          | 100ms   | 10 Mbps         | 8.34 Mbps         | 83.44 %     | 99.98 %     |
| Cable_10Mbps_200ms          | 200ms   | 10 Mbps         | 7.47 Mbps         | 74.68 %     | 99.98 %     |
| LongDistCable_10Mbps_300ms  | 300ms   | 10 Mbps         | 5.95 Mbps         | 59.51 %     | 99.99 %     |
| Cable_50Mbps_1ms            | 1ms     | 50 Mbps         | 48.23 Mbps        | 96.46 %     | 99.88 %     |
| Cable_50Mbps_10ms           | 10ms    | 50 Mbps         | 47.96 Mbps        | 95.93 %     | 99.89 %     |
| Cable_50Mbps_100ms          | 100ms   | 50 Mbps         | 36.21 Mbps        | 72.42 %     | 99.91 %     |
| Cable_50Mbps_200ms          | 200ms   | 50 Mbps         | 25.02 Mbps        | 50.04 %     | 99.94 %     |
| LongDistCable_50Mbps_300ms  | 300ms   | 50 Mbps         | 18.32 Mbps        | 36.64 %     | 99.95 %     |
| DSL_20Mbps_25ms             | 25ms    | 20 Mbps         | 18.18 Mbps        | 90.90 %     | 99.95 %     |
| LTE_30Mbps_40ms             | 40ms    | 30 Mbps         | 26.42 Mbps        | 88.06 %     | 99.93 %     |
+-----------------------------+---------+-----------------+-------------------+-------------+-------------+

After:

+-----------------------------+---------+-----------------+-------------------+-------------+-------------+
|          SCENARIO           | LATENCY | BANDWIDTH LIMIT | ACTUAL THROUGHPUT | UTILIZATION | PACKET LOSS |
+-----------------------------+---------+-----------------+-------------------+-------------+-------------+
| Fiber_200Mbps_1ms           | 1ms     | 200 Mbps        | 152.58 Mbps       | 76.29 %     | 99.87 %     |
| LongDistFiber_200Mbps_200ms | 200ms   | 200 Mbps        | 84.32 Mbps        | 42.16 %     | 99.93 %     |
| Fiber_100Mbps_1ms           | 1ms     | 100 Mbps        | 90.64 Mbps        | 90.64 %     | 99.93 %     |
| LongDistFiber_100Mbps_200ms | 200ms   | 100 Mbps        | 58.03 Mbps        | 58.03 %     | 99.95 %     |
| Cable_10Mbps_1ms            | 1ms     | 10 Mbps         | 9.74 Mbps         | 97.45 %     | 99.99 %     |
| Cable_10Mbps_10ms           | 10ms    | 10 Mbps         | 9.75 Mbps         | 97.50 %     | 99.99 %     |
| Cable_10Mbps_100ms          | 100ms   | 10 Mbps         | 8.58 Mbps         | 85.76 %     | 99.99 %     |
| Cable_10Mbps_200ms          | 200ms   | 10 Mbps         | 7.94 Mbps         | 79.42 %     | 99.99 %     |
| LongDistCable_10Mbps_300ms  | 300ms   | 10 Mbps         | 7.08 Mbps         | 70.76 %     | 99.99 %     |
| Cable_50Mbps_1ms            | 1ms     | 50 Mbps         | 47.71 Mbps        | 95.41 %     | 99.96 %     |
| Cable_50Mbps_10ms           | 10ms    | 50 Mbps         | 47.60 Mbps        | 95.20 %     | 99.96 %     |
| Cable_50Mbps_100ms          | 100ms   | 50 Mbps         | 37.31 Mbps        | 74.61 %     | 99.97 %     |
| Cable_50Mbps_200ms          | 200ms   | 50 Mbps         | 30.52 Mbps        | 61.05 %     | 99.98 %     |
| LongDistCable_50Mbps_300ms  | 300ms   | 50 Mbps         | 25.11 Mbps        | 50.23 %     | 99.98 %     |
| DSL_20Mbps_25ms             | 25ms    | 20 Mbps         | 18.29 Mbps        | 91.43 %     | 99.99 %     |
| LTE_30Mbps_40ms             | 40ms    | 30 Mbps         | 26.38 Mbps        | 87.92 %     | 99.98 %     |
+-----------------------------+---------+-----------------+-------------------+-------------+-------------+

pymq added 4 commits January 3, 2026 15:47
this drastically reduces scheduler overhead for high bandwidth networks
this reduces syscalls count, but only for Linux
also increase outbound buffer and increase packets limit per stream
@pymq pymq added this to the v0.15.0 milestone Jan 8, 2026
@pymq
pymq merged commit 6d19268 into master Jan 8, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant