Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions docs/network.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ RootlessKit provides several drivers for providing network connectivity:
* `--net=lxc-user-nic`: use `lxc-user-nic` (experimental)
* `--net=gvisor-tap-vsock`: use [gvisor-tap-vsock](https://github.com/containers/gvisor-tap-vsock) (experimental)

[Benchmark: iperf3 from the child to the parent (Apr 10, 2026)](https://github.com/rootless-containers/rootlesskit/actions/runs/24200485791/job/70642399211):
[Benchmark: iperf3 from the child to the parent (Jul 26, 2026)](https://github.com/rootless-containers/rootlesskit/actions/runs/30191669102/job/89765864664):

| Driver | MTU=1500 | MTU=65520
|---------------------------------------|------------|-------------
|`slirp4netns` | 0.84 Gbps | 6.17 Gbps
|`slirp4netns` (with sandbox + seccomp) | 0.80 Gbps | 6.19 Gbps
|`vpnkit` | 0.10 Gbps |(Unsupported)
|`pasta` | 0.87 Gbps | 6.48 Gbps
|`gvisor-tap-vsock` | 1.55 Gbps | 5.40 Gbps
|`lxc-user-nic` | 29.3 Gbps | 30.4 Gbps
|(rootful veth) | (35.0 Gbps)| (36.2 Gbps)
|`slirp4netns` | 1.69 Gbps | 8.11 Gbps

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the GHA machine spec was recently upgraded?

|`slirp4netns` (with sandbox + seccomp) | 1.68 Gbps | 8.32 Gbps
|`vpnkit` | 0.14 Gbps |(Unsupported)
|`pasta` | 0.24 Gbps | 31.9 Gbps

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems extremely sensitive to MTU 👀

Eventually we should also have some benchmark with the real Internet

@haytok haytok Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got curious and looked into this.

Root cause:

pasta never sets txqueuelen on tap0, so it stays at the kernel default of 1000 packets. However, the receive window pasta advertises is ~5.5 MB — measured in bytes, independent of MTU. At MTU=1500 that is ~3,700 packets, so every window-sized burst overflows the tun ring buffer. Confirmed with perf record -e skb:kfree_skb, which reports as follows:

$ sudo perf record -e skb:kfree_skb -o /tmp/drops.data -- sleep 180
...
$ sudo perf script -i /tmp/drops.data | grep pasta | head -1
pasta 477878 [003] 442889.154999: skb:kfree_skb: skbaddr=0xffff0000ec228b00 rx_sk=(nil) protocol=2048 location=tun_net_xmit+0x25c reason: FULL_RING

Workaround:

Raising the queue alone (ip link set dev tap0 txqueuelen 2000) is enough even when MTU stays 1500:

[ ID] Interval Transfer Bitrate Retr
[ 6] 0.00-30.00 sec 88.3 GBytes 25.3 Gbits/sec 3074 sender
[ 6] 0.00-30.00 sec 88.3 GBytes 25.3 Gbits/sec receiver

|`gvisor-tap-vsock` | 2.46 Gbps | 8.75 Gbps
|`lxc-user-nic` | 49.1 Gbps | 50.7 Gbps
|(rootful veth) | (49.3 Gbps)| (50.8 Gbps)

* To be documented: [`bypass4netns`](https://github.com/rootless-containers/bypass4netns) for native performance.

Expand Down
4 changes: 2 additions & 2 deletions hack/benchmark-iperf3-net.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash
source $(realpath $(dirname $0))/common.inc.sh
function benchmark::iperf3::pasta() {
INFO "[benchmark:iperf3] slirp4netns ($@)"
INFO "[benchmark:iperf3] pasta ($@)"
statedir=$(mktemp -d)
if echo "$@" | grep -q -- --detach-netns; then
IPERF3C="nsenter -n${statedir}/netns $IPERF3C"
fi
set -x
$ROOTLESSKIT --state-dir=$statedir --net=slirp4netns $@ -- $IPERF3C 10.0.2.2
$ROOTLESSKIT --state-dir=$statedir --net=pasta $@ -- $IPERF3C 10.0.2.2
set +x
}

Expand Down