WireGuard Throughput: Where the Gigabits Actually Go

WireGuard’s reputation for speed comes from a simple design and modern cryptography. In practice, tunnels often deliver a fraction of the link speed, and the cause is rarely the cryptography. It is usually maximum transmission unit handling, a single busy core, or a userspace implementation doing copies.

The short version: measure the tunnel’s achievable throughput, check the path MTU, and confirm you are using the kernel implementation on both ends before blaming the protocol.

MTU, and why it silently halves throughput

The tunnel adds headers, so the inner packet must be smaller than the path’s maximum. If the tunnel interface is configured with the same MTU as the physical link, oversized packets are fragmented or dropped, and the symptoms are subtle: connections that work for small transfers and stall on large ones, file copies that crawl, and TLS handshakes that intermittently fail.

Set the tunnel MTU below the physical MTU by the encapsulation overhead, verify with a path MTU probe using an oversized packet and the do-not-fragment flag, and confirm that the tunnel interface reports the intended value. A tunnel that reports 1420 but transmits 1500-byte frames is a tunnel whose problems will be blamed on the application.

One core per tunnel

The kernel implementation processes packets for a given tunnel on a single thread in many configurations, which caps throughput at the speed one core can encrypt, copy, and route. On a machine with many cores and a fast link, this cap is the limit, and it shows as one saturated core and modest aggregate throughput.

The fix is parallelism at the level of tunnels or flows: multiple tunnel interfaces with traffic distributed across them, or a routing setup that spreads flows across cores. For a single tunnel carrying a single large flow, the limit stands, and no amount of CPU headroom on other cores helps.

Userspace implementations cost copies

A userspace implementation of the protocol — commonly used on platforms without a kernel module — moves packets through user memory, which adds copies and context switches per packet. Throughput on such implementations is often a few hundred megabits per core, which is perfectly adequate for a laptop and a poor choice for a gateway.

On routers and small appliances, check which implementation is in use before concluding that the hardware is slow. The same box with the kernel module can be several times faster, and the difference is invisible in any configuration screen.

Latency and the handshake

WireGuard rekeys quietly and keeps a small amount of state. Latency through a tunnel is close to the underlying path plus processing, and the noticeable difference appears in connection establishment rather than in steady state. A tunnel that feels slow to start is usually suffering from MTU-driven retransmission rather than from key exchange.

Measure with a steady-state transfer and a small-packet test separately. Throughput on large packets can look fine while a request-response workload over the same tunnel is visibly sluggish, and the two diagnostics point at different fixes.

Testing that actually measures the tunnel

Measure end to end through the tunnel with a tool that reports per-stream and aggregate rates, run it from a machine on the far side rather than from the tunnel host, and record CPU utilisation during the test. A test run from the tunnel endpoint measures the loopback and flatters everything.

Repeat with parallel streams to see whether the limit is per-flow or per-tunnel. That single distinction tells you whether the answer is more tunnels or a faster core, and it is the measurement most troubleshooting skips.

What a gateway actually costs

A tunnel endpoint on a small appliance shares a CPU with routing, firewalling, and often a container runtime. Encryption competes with all of it, and the throughput ceiling is the sum of those demands rather than the cipher’s alone. Measuring CPU during a transfer shows whether one core is saturated by encryption or by packet processing, and the two have different fixes.

Offloading helps where the platform supports it and the driver is configured correctly, and it silently does nothing when the offload path is bypassed. Check counters rather than trusting a checkbox, because an offload that is enabled but not used looks identical in a settings screen.

Why parallel streams change the answer

A single TCP stream over a tunnel is subject to congestion control, and its throughput is limited by round-trip time and loss as much as by bandwidth. Parallel streams fill the tunnel more completely, so the difference between single-stream and aggregate results tells you whether the limit is the path or the endpoint. Reading the two numbers together is the whole diagnostic.

Test over a path with realistic latency. A tunnel measured across a data centre aisle looks excellent and says nothing about a home connection with a hundred milliseconds of round trip and two percent loss.

Keep the test repeatable

Script the measurement: same endpoints, same duration, same payload, recorded CPU and throughput. Repeatable numbers settle arguments about whether a change helped, and they catch regressions after an MTU or offload adjustment that was supposed to be an improvement.

What to check before you commit

  • Set tunnel MTU below path MTU and verify with a do-not-fragment probe.
  • Check CPU utilisation per core during a throughput test.
  • Confirm the kernel implementation is in use on gateways.
  • Test from the far side of the tunnel, not from the endpoint.
  • Compare single-stream and parallel-stream results.
  • Separate small-packet latency from bulk throughput.

WireGuard is fast enough that the protocol is rarely the problem. The bottlenecks are configuration and packet handling, and both are measurable in an afternoon with tools that are already installed.

Photo: Cloud899, via Wikimedia Commons (CC BY-SA 4.0).

Keeping the tunnel predictable under load

Under sustained load, a tunnel’s behaviour depends on queueing as much as on crypto. A gateway with small queues drops bursts, which the transport reads as congestion and answers by slowing down for everyone sharing the tunnel. Enlarging queues helps throughput and adds latency, which is the classic bufferbloat trade.

The practical compromise is a modest queue plus traffic shaping so that bulk transfers fill less than the link. Measured latency under load, rather than a speed test on an idle connection, is the number that tells you whether the configuration is tolerable for interactive work.

Leave a Comment