Skip to content

Benchmarks

hev edited this page Sep 29, 2024 · 2 revisions

Benchmarks

Summary

Speed

CPU usage

Memory usage

Hardware/Software

CPU: AMD Ryzen 9 7950X 16-Core Processor (Max 5.7GHz)

OS: Arch Linux (Linux 6.6.9)

Socks5 server

Repo: https://github.com/heiher/hev-socks5-server

Version: 2.6.2

Topology

Namespace host                         Namespace guest
eth0:  192.168.0.8
veth0: 192.168.1.1                     veth1: 192.168.1.2
socks5 server(listen on: 192.168.1.1)  tun2socks(connect to: 192.168.1.1)
iperf3 server(listen on: 192.168.0.8)  iperf3 client(connect to: 192.168.0.8)

MTU

eth0/veth0/veth1: 1500

tun0: 8500

hev-socks5-tunnel

Repo: https://github.com/heiher/hev-socks5-tunnel

Version: 2.6.5

Command:

# Multi-queue on, 4 processes
hev-socks5-tunnel conf/main.yml

Upload

$ iperf3 -c 192.168.0.8
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   0.00-10.00  sec  23.9 GBytes  20.5 Gbits/sec    0             sender
[  5]   0.00-10.05  sec  23.9 GBytes  20.4 Gbits/sec                  receiver
CPU usage: 76%
MEM usage: 2.7M
$ iperf3 -c 192.168.0.8 -P 10
- - - - - - - - - - - - - - - - - - - - - - - - -
[SUM]   0.00-10.00  sec  94.6 GBytes  81.3 Gbits/sec    0             sender
[SUM]   0.00-10.04  sec  94.6 GBytes  81.0 Gbits/sec                  receiver
CPU usage 1: 68%
CPU usage 2: 64%
CPU usage 3: 42%
CPU usage 4: 28%
MEM usage 1: 2.7M
MEM usage 2: 2.7M
MEM usage 3: 2.5M
MEM usage 4: 2.7M

Download

$ iperf3 -c 192.168.0.8 -R
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   0.00-10.04  sec  29.5 GBytes  25.2 Gbits/sec    0             sender
[  5]   0.00-10.00  sec  29.5 GBytes  25.3 Gbits/sec                  receiver
CPU usage: 90%
MEM usage: 2.7M
$ iperf3 -c 192.168.0.8 -R -P 10
- - - - - - - - - - - - - - - - - - - - - - - - -
[SUM]   0.00-10.04  sec  95.9 GBytes  82.0 Gbits/sec    0             sender
[SUM]   0.00-10.00  sec  95.8 GBytes  82.3 Gbits/sec                  receiver
CPU usage 1: 90%
CPU usage 2: 90%
CPU usage 3: 50%
CPU usage 4: 50%
MEM usage 1: 2.7M
MEM usage 2: 2.7M
MEM usage 3: 2.7M
MEM usage 4: 2.7M

sing-box

Repo: https://github.com/SagerNet/sing-box

Version: 1.9.6

Command:

sing-box -c tun2socks.json run
{
  "inbounds": [
    {
        "type": "tun",
        "inet4_address": "192.168.0.1/24",
        "mtu": 8500,
        "auto_route": false,
        "strict_route": false
    }
  ],
  "outbounds": [
    {
        "type": "socks",
        "tag": "socks-out",
        "server": "192.168.1.1",
        "server_port": 1080,
        "version": "5"
    }
  ]
}

Upload

$ iperf3 -c 192.168.0.8
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   0.00-10.00  sec  22.3 GBytes  19.2 Gbits/sec    0             sender
[  5]   0.00-10.04  sec  22.3 GBytes  19.1 Gbits/sec                  receiver
CPU usage: 90%
MEM usage: 37.7M
$ iperf3 -c 192.168.0.8 -P 10
- - - - - - - - - - - - - - - - - - - - - - - - -
[SUM]   0.00-10.00  sec  20.3 GBytes  17.4 Gbits/sec  6534             sender
[SUM]   0.00-10.04  sec  20.2 GBytes  17.3 Gbits/sec                  receiver
CPU usage: 160%
MEM usage: 37.7M

Download

$ iperf3 -c 192.168.0.8 -R
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   0.00-10.04  sec  19.5 GBytes  16.6 Gbits/sec    1             sender
[  5]   0.00-10.00  sec  19.4 GBytes  16.7 Gbits/sec                  receiver
CPU usage: 140%
MEM usage: 41.7M
$ iperf3 -c 192.168.0.8 -R -P 10
- - - - - - - - - - - - - - - - - - - - - - - - -
[SUM]   0.00-10.04  sec  17.3 GBytes  14.8 Gbits/sec  2828             sender
[SUM]   0.00-10.00  sec  17.1 GBytes  14.7 Gbits/sec                  receiver
CPU usage: 122%
MEM usage: 41.7M

xjasonlyu-tun2socks

Repo: https://github.com/xjasonlyu/tun2socks

Version: 2.5.2

Command:

tun2socks-linux-amd64 -device tun0 -mtu 8500 -proxy socks5://192.168.1.1:1080

Upload

$ iperf3 -c 192.168.0.8
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   0.00-10.00  sec  10.9 GBytes  9.37 Gbits/sec    0             sender
[  5]   0.00-10.04  sec  10.9 GBytes  9.33 Gbits/sec                  receiver
CPU usage: 200%
MEM usage: 20M
$ iperf3 -c 192.168.0.8 -P 10
- - - - - - - - - - - - - - - - - - - - - - - - -
[SUM]   0.00-10.00  sec  10.3 GBytes  8.82 Gbits/sec  9985             sender
[SUM]   0.00-10.05  sec  10.3 GBytes  8.77 Gbits/sec                  receiver
CPU usage: 200%
MEM usage: 23M

Download

$ iperf3 -c 192.168.0.8 -R
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   0.00-10.04  sec  7.72 GBytes  6.60 Gbits/sec    0             sender
[  5]   0.00-10.00  sec  7.71 GBytes  6.62 Gbits/sec                  receiver
CPU usage: 148%
MEM usage: 20M
$ iperf3 -c 192.168.0.8 -R -P 10
- - - - - - - - - - - - - - - - - - - - - - - - -
[SUM]   0.00-10.24  sec  46.5 GBytes  39.0 Gbits/sec    7             sender
[SUM]   0.00-10.00  sec  46.3 GBytes  39.8 Gbits/sec                  receiver
CPU usage: 1094%
MEM usage: 110M

clash-tun2socks

Repo: https://github.com/Dreamacro/clash

Version: Premium 2023.03.04

Command:

clash-linux-amd64-2023.03.04 -f clash.yml

Upload

$ iperf3 -c 192.168.0.8
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   0.00-10.00  sec  12.6 GBytes  10.8 Gbits/sec    0             sender
[  5]   0.00-10.00  sec  12.6 GBytes  10.8 Gbits/sec                  receiver
CPU usage: 210%
MEM usage: 32M
$ iperf3 -c 192.168.0.8 -P 10
- - - - - - - - - - - - - - - - - - - - - - - - -
[SUM]   0.00-10.00  sec  11.8 GBytes  10.1 Gbits/sec  2905             sender
[SUM]   0.00-10.00  sec  11.8 GBytes  10.1 Gbits/sec                  receiver
CPU usage: 220%
MEM usage: 43M

Download

$ iperf3 -c 192.168.0.8 -R
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   0.00-10.00  sec  4.59 GBytes  3.95 Gbits/sec    0             sender
[  5]   0.00-10.00  sec  4.59 GBytes  3.94 Gbits/sec                  receiver
CPU usage: 340%
MEM usage: 23M
$ iperf3 -c 192.168.0.8 -R -P 10
- - - - - - - - - - - - - - - - - - - - - - - - -
[SUM]   0.00-10.00  sec  7.93 GBytes  6.81 Gbits/sec    0             sender
[SUM]   0.00-10.00  sec  7.86 GBytes  6.75 Gbits/sec                  receiver
CPU usage: 340%
MEM usage: 43M

go-tun2socks

Repo: https://github.com/eycorsican/go-tun2socks

Version: 1.16.11

Command:

tun2socks-linux-amd64 -proxyServer 192.168.1.1:1080 -tunName tun0 -tunPersist

Upload

$ iperf3 -c 192.168.0.8
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   0.00-10.00  sec  1.24 GBytes  1.07 Gbits/sec    0             sender
[  5]   0.00-10.04  sec  1.24 GBytes  1.06 Gbits/sec                  receiver
CPU usage: 120%
MEM usage: 17M
$ iperf3 -c 192.168.0.8 -P 10
- - - - - - - - - - - - - - - - - - - - - - - - -
[SUM]   0.00-10.00  sec  1.27 GBytes  1.09 Gbits/sec    0             sender
[SUM]   0.00-10.04  sec  1.27 GBytes  1.08 Gbits/sec                  receiver
CPU usage: 154%
MEM usage: 19M

Download

$ iperf3 -c 192.168.0.8 -R
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   0.00-10.04  sec  4.84 GBytes  4.14 Gbits/sec    0             sender
[  5]   0.00-10.00  sec  4.83 GBytes  4.15 Gbits/sec                  receiver
CPU usage: 140%
MEM usage: 19M
$ iperf3 -c 192.168.0.8 -R -P 10
- - - - - - - - - - - - - - - - - - - - - - - - -
[SUM]   0.00-10.04  sec  4.47 GBytes  3.82 Gbits/sec  875             sender
[SUM]   0.00-10.00  sec  4.35 GBytes  3.74 Gbits/sec                  receiver
CPU usage: 140%
MEM usage: 24M

leaf-tun2socks

Repo: https://github.com/eycorsican/leaf

Version: 0.10.7

Command:

leaf-x86_64-unknown-linux-musl -c tun2socks.json
{
    "inbounds": [
        {
            "protocol": "tun",
            "settings": {
                "name": "utun8",
                "address": "198.18.0.1",
                "netmask": "255.255.255.255",
                "gateway": "198.18.0.1",
                "mtu": 8500,
                "fakeDnsInclude": [
                    "google"
                ]
            },
            "tag": "tun_in"
        }
    ],
    "outbounds": [
        {
            "protocol": "socks",
            "settings": {
                "address": "192.168.1.1",
                "port": 1080
            },
            "tag": "socks_out"
        }
    ]
}

Upload

$ iperf3 -c 192.168.0.8
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   0.00-10.00  sec  3.44 GBytes  2.96 Gbits/sec    0             sender
[  5]   0.00-10.00  sec  3.44 GBytes  2.96 Gbits/sec                  receiver
CPU usage: 166%
MEM usage: 19M
$ iperf3 -c 192.168.0.8 -P 10
- - - - - - - - - - - - - - - - - - - - - - - - -
[SUM]   0.00-10.00  sec  3.20 GBytes  2.75 Gbits/sec    0             sender
[SUM]   0.00-10.00  sec  3.20 GBytes  2.75 Gbits/sec                  receiver
CPU usage: 188%
MEM usage: 19M

Download

$ iperf3 -c 192.168.0.8 -R
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   0.00-10.00  sec  3.07 GBytes  2.64 Gbits/sec    0             sender
[  5]   0.00-10.00  sec  3.06 GBytes  2.63 Gbits/sec                  receiver
CPU usage: 170%
MEM usage: 16M
$ iperf3 -c 192.168.0.8 -R -P 10
- - - - - - - - - - - - - - - - - - - - - - - - -
[SUM]   0.00-10.00  sec   736 MBytes   617 Mbits/sec  162             sender
[SUM]   0.00-10.00  sec   638 MBytes   535 Mbits/sec                  receiver
CPU usage: 230%
MEM usage: 14M

badvpn-tun2socks

Repo: https://github.com/ambrop72/badvpn

Version: 1.999.130

Command:

badvpn-tun2socks --tundev tun0 --socks-server-addr 192.168.1.1:1080 --netif-ipaddr 10.0.0.1 --netif-netmask 255.255.255.0

Upload

$ iperf3 -c 192.168.0.8
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   0.00-10.00  sec  2.39 GBytes  2.05 Gbits/sec    0             sender
[  5]   0.00-10.04  sec  2.39 GBytes  2.04 Gbits/sec                  receiver
CPU usage: 76%
MEM usage: 1M
$ iperf3 -c 192.168.0.8 -P 10
- - - - - - - - - - - - - - - - - - - - - - - - -
[SUM]   0.00-10.00  sec  2.55 GBytes  2.19 Gbits/sec    0             sender
[SUM]   0.00-10.04  sec  2.55 GBytes  2.18 Gbits/sec                  receiver
CPU usage: 76%
MEM usage: 2M

Download

$ iperf3 -c 192.168.0.8 -R
- - - - - - - - - - - - - - - - - - - - - - - - -
[  5]   0.00-10.04  sec  4.89 GBytes  4.19 Gbits/sec    0             sender
[  5]   0.00-10.00  sec  4.88 GBytes  4.19 Gbits/sec                  receiver
CPU usage: 96%
MEM usage: 2M
$ iperf3 -c 192.168.0.8 -R -P 10
- - - - - - - - - - - - - - - - - - - - - - - - -
[SUM]   0.00-10.04  sec  4.23 GBytes  3.62 Gbits/sec  113             sender
[SUM]   0.00-10.00  sec  4.14 GBytes  3.56 Gbits/sec                  receiver
CPU usage: 94%
MEM usage: 2.8M