microsoft / microsoft/WSL

Windows to WSL TCP localhost throughput is much slower than WSL to Windows under mirrored networking

Open
#40,965 8 comments 0 reactions 0 assignees View on GitHub
network
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

### Windows Version

Microsoft Windows [版本 10.0.26200.8655]

### WSL Version

2.9.3.0

### Are you using WSL 1 or WSL 2?

- [x] WSL 2
- [ ] WSL 1

### Kernel Version

6.18.35.2-1

### Distro Version

Ubuntu 24.04.4 LTS

### Other Software

Windows iperf3 3.21
Ubuntu iperf3 3.16

No Docker.
No Visual Studio Code Remote WSL.
The benchmark only uses iperf3 over localhost.

### Repro Steps

1. Upgrade WSL to 2.9.3 (Public Preview).

2. Configure WSL to use mirrored networking.

3. Verify networking mode:
wslinfo --networking-mode => mirrored

4. Install iperf3 on both Windows and Ubuntu.

5. Start the server inside WSL:

```bash
iperf3 -s -B 0.0.0.0

6. Run from Windows:
iperf3.exe -c 127.0.0.1

7. Repeat using:
iperf3.exe -c 127.0.0.1 -P 4
iperf3.exe -c 127.0.0.1 -P 8
iperf3.exe -c 127.0.0.1 -P 16

8. Reverse the direction:
Run Windows as server and execute:
iperf3 -c 127.0.0.1

inside WSL.

---

# Expected Behavior

```text
Since mirrored networking significantly improves localhost integration,
I expected localhost TCP throughput between Windows and WSL to be similar in both directions.

The throughput should be similar in both directions under localhost.

### Expected Behavior

I expected localhost TCP throughput between Windows and WSL to be similar in both directions when using mirrored networking.

Based on the networking improvements introduced in WSL 2.9.3, I expected Windows -> WSL and WSL -> Windows localhost TCP performance to be comparable, especially for a single TCP stream.

A large throughput difference between the two directions was unexpected.

### Actual Behavior

Measured throughput:

| Direction | Result |
|-----------|--------|
| WSL -> WSL | 9.48 Gbps |
| WSL -> Windows | 15.3 Gbps |
| Windows -> WSL (1 stream) | 1.50 Gbps |
| Windows -> WSL (4 streams) | 3.92 Gbps |
| Windows -> WSL (8 streams) | 6.25 Gbps |
| Windows -> WSL (16 streams) | 4.3 Gbps |

Windows -> WSL single TCP stream appears significantly slower than the reverse direction.

The issue is reproducible on every test.

This behavior may impact AI or image-processing workloads where a Windows application continuously streams large amounts of data into WSL.

I would like to know whether this is expected behavior or if Windows -> WSL localhost traffic still uses a different forwarding path than WSL -> Windows.

Thank you for the work on WSL.

I upgraded to WSL 2.9.3 specifically to evaluate the networking improvements announced at Microsoft Build 2026.

The measurements above are shared in case they help identify a remaining performance issue.

### Diagnostic Logs

No additional logs available.

If required, I can provide:

- wsl --version
- wslinfo --networking-mode
- iperf3 outputs
- Windows build information

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported iperf3 tests with mirrored networking, using the Windows-to-WSL and WSL-to-Windows commands and stream counts listed in the issue. Compare the throughput in both directions and investigate whether they use different localhost forwarding paths. Done means identifying the cause or confirming the expected behavior and documenting the result.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
networking, operating-systems, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.