Replies: 6 comments 8 replies
-
|
I'm looking forward to your benchmark~ |
Beta Was this translation helpful? Give feedback.
-
|
A naive benchmark was carried out against System informationOperating System: Manjaro Linux ❯ ../leaf-x86_64-unknown-linux-gnu --version
leaf 0.2.8 (36aed53 - 2021-02-06 07:37:14 +0800)
❯ clash -v
Clash 1.3.5 linux amd64 unknown time
❯ v2ray -version
V2Ray 4.34.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.15.6 linux/amd64)
A unified platform for anti-censorship.Configurations
{
"inbounds": [
{
"address": "127.0.0.1",
"port": 1087,
"protocol": "socks"
}
],
"log": {
"level": "info"
},
"outbounds": [
{
"protocol": "direct",
"tag": "direct_out"
}
]
}
port: 7890
socks-port: 7891
mode: direct
{
"inbounds": [{
"port": 1088,
"listen": "127.0.0.1",
"protocol": "socks"
}],
"outbounds": [{
"protocol": "freedom"
}]
}BenchmarkSetup❯ iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------No Proxy❯ proxychains iperf3 -c 127.0.0.1 -N
Found existing alias for "proxychains". You should use: "pc"
[proxychains] config file found: /etc/proxychains.conf
[proxychains] preloading /usr/lib/libproxychains4.so
[proxychains] DLL init: proxychains-ng 4.14
Connecting to host 127.0.0.1, port 5201
[ 9] local 127.0.0.1 port 46596 connected to 127.0.0.1 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 9] 0.00-1.00 sec 6.45 GBytes 55.4 Gbits/sec 0 1.19 MBytes
[ 9] 1.00-2.00 sec 6.32 GBytes 54.3 Gbits/sec 0 1.19 MBytes
[ 9] 2.00-3.00 sec 6.53 GBytes 56.1 Gbits/sec 0 1.19 MBytes
[ 9] 3.00-4.00 sec 6.61 GBytes 56.8 Gbits/sec 0 1.19 MBytes
[ 9] 4.00-5.00 sec 6.62 GBytes 56.9 Gbits/sec 0 2.75 MBytes
[ 9] 5.00-6.00 sec 6.61 GBytes 56.7 Gbits/sec 0 2.75 MBytes
[ 9] 6.00-7.00 sec 6.49 GBytes 55.8 Gbits/sec 0 2.75 MBytes
[ 9] 7.00-8.00 sec 6.58 GBytes 56.5 Gbits/sec 0 2.75 MBytes
[ 9] 8.00-9.00 sec 6.54 GBytes 56.2 Gbits/sec 0 2.75 MBytes
[ 9] 9.00-10.00 sec 6.63 GBytes 56.9 Gbits/sec 0 2.75 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 9] 0.00-10.00 sec 65.4 GBytes 56.2 Gbits/sec 0 sender
[ 9] 0.00-10.00 sec 65.4 GBytes 56.2 Gbits/sec receiver
iperf Done.
╭─ ~/rust/leaf/benchmark ··································································· ✔ 10s
╰─ Leaf❯ proxychains iperf3 -c 192.168.0.36 -N
Found existing alias for "proxychains". You should use: "pc"
[proxychains] config file found: /etc/proxychains.conf
[proxychains] preloading /usr/lib/libproxychains4.so
[proxychains] DLL init: proxychains-ng 4.14
[proxychains] Strict chain ... 127.0.0.1:1087 ... 192.168.0.36:5201 ... OK
Connecting to host 192.168.0.36, port 5201
[proxychains] Strict chain ... 127.0.0.1:1087 ... 192.168.0.36:5201 ... OK
[ 9] local 127.0.0.1 port 51738 connected to 127.0.0.1 port 1087
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 9] 0.00-1.00 sec 1006 MBytes 8.44 Gbits/sec 0 1.31 MBytes
[ 9] 1.00-2.00 sec 995 MBytes 8.35 Gbits/sec 0 1.31 MBytes
[ 9] 2.00-3.00 sec 994 MBytes 8.34 Gbits/sec 0 1.31 MBytes
[ 9] 3.00-4.00 sec 970 MBytes 8.14 Gbits/sec 0 1.31 MBytes
[ 9] 4.00-5.00 sec 1001 MBytes 8.40 Gbits/sec 0 1.31 MBytes
[ 9] 5.00-6.00 sec 995 MBytes 8.35 Gbits/sec 0 1.31 MBytes
[ 9] 6.00-7.00 sec 984 MBytes 8.25 Gbits/sec 0 1.31 MBytes
[ 9] 7.00-8.00 sec 1005 MBytes 8.43 Gbits/sec 0 1.31 MBytes
[ 9] 8.00-9.00 sec 1006 MBytes 8.44 Gbits/sec 0 1.31 MBytes
[ 9] 9.00-10.00 sec 1000 MBytes 8.39 Gbits/sec 0 1.31 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 9] 0.00-10.00 sec 9.72 GBytes 8.35 Gbits/sec 0 sender
[ 9] 0.00-10.01 sec 9.72 GBytes 8.34 Gbits/sec receiver
iperf Done.
╭─ ~/rust/leaf/benchmark ··································································· ✔ 10s
╰─ Clash❯ proxychains iperf3 -c 192.168.0.36 -N
Found existing alias for "proxychains". You should use: "pc"
[proxychains] config file found: /etc/proxychains.conf
[proxychains] preloading /usr/lib/libproxychains4.so
[proxychains] DLL init: proxychains-ng 4.14
[proxychains] Strict chain ... 127.0.0.1:7891 ... 192.168.0.36:5201 ... OK
Connecting to host 192.168.0.36, port 5201
[proxychains] Strict chain ... 127.0.0.1:7891 ... 192.168.0.36:5201 ... OK
[ 9] local 127.0.0.1 port 55444 connected to 127.0.0.1 port 7891
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 9] 0.00-1.00 sec 1.85 GBytes 15.9 Gbits/sec 0 1.31 MBytes
[ 9] 1.00-2.00 sec 1.88 GBytes 16.1 Gbits/sec 0 1.44 MBytes
[ 9] 2.00-3.00 sec 1.95 GBytes 16.8 Gbits/sec 0 1.44 MBytes
[ 9] 3.00-4.00 sec 1.89 GBytes 16.3 Gbits/sec 0 1.56 MBytes
[ 9] 4.00-5.00 sec 1.83 GBytes 15.7 Gbits/sec 0 1.56 MBytes
[ 9] 5.00-6.00 sec 1.85 GBytes 15.9 Gbits/sec 0 1.56 MBytes
[ 9] 6.00-7.00 sec 1.85 GBytes 15.9 Gbits/sec 0 1.56 MBytes
[ 9] 7.00-8.00 sec 1.83 GBytes 15.8 Gbits/sec 0 1.75 MBytes
[ 9] 8.00-9.00 sec 1.91 GBytes 16.4 Gbits/sec 0 1.75 MBytes
[ 9] 9.00-10.00 sec 1.89 GBytes 16.2 Gbits/sec 0 1.75 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 9] 0.00-10.00 sec 18.7 GBytes 16.1 Gbits/sec 0 sender
[ 9] 0.00-10.00 sec 18.7 GBytes 16.1 Gbits/sec receiver
iperf Done.
╭─ ~/rust/leaf/benchmark ··································································· ✔ 10s
╰─ V2Ray❯ proxychains iperf3 -c 192.168.0.36 -N
Found existing alias for "proxychains". You should use: "pc"
[proxychains] config file found: /etc/proxychains.conf
[proxychains] preloading /usr/lib/libproxychains4.so
[proxychains] DLL init: proxychains-ng 4.14
[proxychains] Strict chain ... 127.0.0.1:1088 ... 192.168.0.36:5201 ... OK
Connecting to host 192.168.0.36, port 5201
[proxychains] Strict chain ... 127.0.0.1:1088 ... 192.168.0.36:5201 ... OK
[ 9] local 127.0.0.1 port 49162 connected to 127.0.0.1 port 1088
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 9] 0.00-1.00 sec 2.86 GBytes 24.6 Gbits/sec 0 1.25 MBytes
[ 9] 1.00-2.00 sec 2.93 GBytes 25.1 Gbits/sec 0 1.25 MBytes
[ 9] 2.00-3.00 sec 2.89 GBytes 24.8 Gbits/sec 0 1.25 MBytes
[ 9] 3.00-4.00 sec 2.92 GBytes 25.1 Gbits/sec 0 1.25 MBytes
[ 9] 4.00-5.00 sec 2.92 GBytes 25.0 Gbits/sec 0 1.25 MBytes
[ 9] 5.00-6.00 sec 2.91 GBytes 25.0 Gbits/sec 0 1.25 MBytes
[ 9] 6.00-7.00 sec 2.90 GBytes 24.9 Gbits/sec 0 1.25 MBytes
[ 9] 7.00-8.00 sec 2.93 GBytes 25.1 Gbits/sec 0 1.25 MBytes
[ 9] 8.00-9.00 sec 2.92 GBytes 25.0 Gbits/sec 0 1.25 MBytes
[ 9] 9.00-10.00 sec 2.89 GBytes 24.8 Gbits/sec 0 1.25 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 9] 0.00-10.00 sec 29.1 GBytes 25.0 Gbits/sec 0 sender
[ 9] 0.00-10.00 sec 29.0 GBytes 24.9 Gbits/sec receiver
iperf Done.
╭─ ~/rust/leaf/benchmark ··································································· ✔ 10s
╰─ |
Beta Was this translation helpful? Give feedback.
-
|
@eycorsican may I know how |
Beta Was this translation helpful? Give feedback.
-
|
A benchmark for the TUN inbound. EnvHardware Overview: Model Name: MacBook Pro System Software Overview: System Version: macOS 11.2.2 (20D80) MethodInitiate traffic from WorkflowmacOS> cat redirect.json
{
"log": {
"level": "trace"
},
"dns": {
"servers": [
"1.1.1.1"
]
},
"inbounds": [
{
"protocol": "tun",
"settings": {
"name": "utun8",
"address": "10.10.0.2",
"netmask": "255.255.255.0",
"gateway": "10.10.0.1",
"mtu": 1500
}
}
],
"outbounds": [
{
"protocol": "redirect",
"tag": "redirect",
"settings": {
"address": "127.0.0.1",
"port": 1234
}
}
]
}
> sudo leaf -c redirect.json
> sudo ifconfig utun7 10.10.0.2 netmask 255.255.255.0 10.10.0.1
> sudo route add 1.2.3.4/32 10.10.0.1
> iperf3 -s -p 1234
> iperf3 -c 1.2.3.4 -p 1234LinuxIf you're running Linux, the workflow is similar. Note that we use a different TUN name and we don't need to manually configure the TUN interface address. > cat redirect.json
{
"log": {
"level": "trace"
},
"dns": {
"servers": [
"1.1.1.1"
]
},
"inbounds": [
{
"protocol": "tun",
"settings": {
"name": "tun8",
"address": "10.10.0.2",
"netmask": "255.255.255.0",
"gateway": "10.10.0.1",
"mtu": 1500
}
}
],
"outbounds": [
{
"protocol": "redirect",
"tag": "redirect",
"settings": {
"address": "127.0.0.1",
"port": 1234
}
}
]
}
> sudo leaf -c redirect.json
> sudo ip route add 1.2.3.4 via 10.10.0.1
> iperf3 -s -p 1234
> iperf3 -c 1.2.3.4 -p 1234ResultsNote that I'm using this commit and running leaf with the default settings. TCP uplink> iperf3 -c 1.2.3.4 -p 1234
Connecting to host 1.2.3.4, port 1234
[ 5] local 10.10.0.2 port 57158 connected to 1.2.3.4 port 1234
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 116 MBytes 973 Mbits/sec
[ 5] 1.00-2.00 sec 113 MBytes 947 Mbits/sec
[ 5] 2.00-3.00 sec 104 MBytes 870 Mbits/sec
[ 5] 3.00-4.00 sec 85.5 MBytes 717 Mbits/sec
[ 5] 4.00-5.00 sec 103 MBytes 864 Mbits/sec
[ 5] 5.00-6.00 sec 98.4 MBytes 826 Mbits/sec
[ 5] 6.00-7.00 sec 98.6 MBytes 827 Mbits/sec
[ 5] 7.00-8.00 sec 101 MBytes 844 Mbits/sec
[ 5] 8.00-9.00 sec 97.3 MBytes 816 Mbits/sec
[ 5] 9.00-10.00 sec 101 MBytes 845 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate
[ 5] 0.00-10.00 sec 1017 MBytes 853 Mbits/sec sender
[ 5] 0.00-10.00 sec 1017 MBytes 853 Mbits/sec receiverTCP downlink> iperf3 -c 1.2.3.4 -p 1234 -R
Connecting to host 1.2.3.4, port 1234
Reverse mode, remote host 1.2.3.4 is sending
[ 5] local 10.10.0.2 port 57163 connected to 1.2.3.4 port 1234
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 152 MBytes 1.27 Gbits/sec
[ 5] 1.00-2.00 sec 158 MBytes 1.33 Gbits/sec
[ 5] 2.00-3.00 sec 157 MBytes 1.32 Gbits/sec
[ 5] 3.00-4.00 sec 158 MBytes 1.33 Gbits/sec
[ 5] 4.00-5.00 sec 156 MBytes 1.31 Gbits/sec
[ 5] 5.00-6.00 sec 159 MBytes 1.34 Gbits/sec
[ 5] 6.00-7.00 sec 159 MBytes 1.33 Gbits/sec
[ 5] 7.00-8.00 sec 159 MBytes 1.33 Gbits/sec
[ 5] 8.00-9.00 sec 156 MBytes 1.31 Gbits/sec
[ 5] 9.00-10.00 sec 155 MBytes 1.30 Gbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate
[ 5] 0.00-10.00 sec 1.54 GBytes 1.32 Gbits/sec sender
[ 5] 0.00-10.00 sec 1.53 GBytes 1.32 Gbits/sec receiverUDP uplink> iperf3 -c 1.2.3.4 -p 1234 -u -b 1G
Connecting to host 1.2.3.4, port 1234
[ 5] local 10.10.0.2 port 56625 connected to 1.2.3.4 port 1234
[ ID] Interval Transfer Bitrate Total Datagrams
[ 5] 0.00-1.00 sec 104 MBytes 873 Mbits/sec 74769
[ 5] 1.00-2.00 sec 106 MBytes 892 Mbits/sec 76387
[ 5] 2.00-3.00 sec 102 MBytes 858 Mbits/sec 73452
[ 5] 3.00-4.00 sec 104 MBytes 874 Mbits/sec 74870
[ 5] 4.00-5.00 sec 113 MBytes 946 Mbits/sec 81020
[ 5] 5.00-6.00 sec 112 MBytes 939 Mbits/sec 80414
[ 5] 6.00-7.00 sec 118 MBytes 988 Mbits/sec 84553
[ 5] 7.00-8.00 sec 112 MBytes 943 Mbits/sec 80702
[ 5] 8.00-9.00 sec 110 MBytes 924 Mbits/sec 79124
[ 5] 9.00-10.00 sec 109 MBytes 911 Mbits/sec 78040
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams
[ 5] 0.00-10.00 sec 1.07 GBytes 915 Mbits/sec 0.000 ms 0/783331 (0%) sender
[ 5] 0.00-10.00 sec 883 MBytes 741 Mbits/sec 0.008 ms 146717/781212 (19%) receiverUDP downlink> iperf3 -c 1.2.3.4 -p 1234 -u -b 1G -R
Connecting to host 1.2.3.4, port 1234
Reverse mode, remote host 1.2.3.4 is sending
[ 5] local 10.10.0.2 port 49850 connected to 1.2.3.4 port 1234
[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams
[ 5] 0.00-1.00 sec 80.4 MBytes 675 Mbits/sec 0.019 ms 0/57756 (0%)
[ 5] 1.00-2.00 sec 77.1 MBytes 647 Mbits/sec 0.015 ms 0/55357 (0%)
[ 5] 2.00-3.00 sec 78.0 MBytes 654 Mbits/sec 0.014 ms 0/56012 (0%)
[ 5] 3.00-4.00 sec 77.6 MBytes 651 Mbits/sec 0.012 ms 0/55712 (0%)
[ 5] 4.00-5.00 sec 77.8 MBytes 652 Mbits/sec 0.018 ms 0/55848 (0%)
[ 5] 5.00-6.00 sec 77.8 MBytes 652 Mbits/sec 0.018 ms 0/55845 (0%)
[ 5] 6.00-7.00 sec 77.4 MBytes 649 Mbits/sec 0.014 ms 0/55569 (0%)
[ 5] 7.00-8.00 sec 71.5 MBytes 599 Mbits/sec 0.013 ms 0/51326 (0%)
[ 5] 8.00-9.00 sec 76.7 MBytes 644 Mbits/sec 0.014 ms 0/55099 (0%)
[ 5] 9.00-10.00 sec 78.2 MBytes 656 Mbits/sec 0.014 ms 0/56189 (0%)
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams
[ 5] 0.00-10.00 sec 772 MBytes 648 Mbits/sec 0.000 ms 0/554721 (0%) sender
[ 5] 0.00-10.00 sec 772 MBytes 648 Mbits/sec 0.014 ms 0/554713 (0%) receiver |
Beta Was this translation helpful? Give feedback.
-
|
amux benchmark EnvSame as above Steps to reproduceLeaf version: this commit > cat /usr/local/etc/proxychains.conf
socks5 127.0.0.1 1086
> cat socks_in_ws_amux_trojan_out.json
{
"inbounds": [
{
"address": "127.0.0.1",
"port": 1086,
"protocol": "socks",
"tag": "socks_in"
}
],
"log": {
"level": "trace"
},
"outbounds": [
{
"protocol": "chain",
"settings": {
"actors": [
"amux",
"trojan"
]
},
"tag": "chain_out"
},
{
"protocol": "amux",
"settings": {
"actors": [
"ws"
],
"address": "127.0.0.1",
"concurrency": 100,
"maxAccepts": 100,
"port": 3002
},
"tag": "amux"
},
{
"protocol": "ws",
"settings": {
"path": "/leaf"
},
"tag": "ws"
},
{
"protocol": "trojan",
"settings": {
"password": "123456"
},
"tag": "trojan"
}
]
}
> cat ws_amux_trojan_in_redirect_out.json
{
"inbounds": [
{
"address": "127.0.0.1",
"port": 3002,
"protocol": "chain",
"settings": {
"actors": [
"amux",
"trojan"
]
},
"tag": "chain_in"
},
{
"protocol": "amux",
"settings": {
"actors": [
"ws"
]
},
"tag": "amux"
},
{
"protocol": "ws",
"settings": {
"path": "/leaf"
},
"tag": "ws"
},
{
"protocol": "trojan",
"settings": {
"password": "123456"
},
"tag": "trojan"
}
],
"log": {
"level": "trace"
},
"outbounds": [
{
"protocol": "redirect",
"settings": {
"address": "127.0.0.1",
"port": 1234
},
"tag": "redirect_out"
}
]
}
> LINK_BUFFER_SIZE=32 ./leaf -c socks_in_ws_amux_trojan_out.json
> LINK_BUFFER_SIZE=32 ./leaf -c ws_amux_trojan_in_redirect_out.json
> iperf3 -s -p 1234
> proxychains4 iperf3 -c 1.2.3.4 -p 1234ResultsNote that we're running 2 leaf instances on the same host, it's reasonable to double the numbers when comparing to the above benchmarks. 1 mux stream over 1 mux connectionMultiplexing 8 mux streams over 1 mux connection |
Beta Was this translation helpful? Give feedback.
-
|
https://github.com/heiher/hev-socks5-tunnel/wiki/Benchmarks |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Would it be cool to have a benchmark to show off how this project outperforms its alternatives regarding performance, say V2Ray or Clash?
Beta Was this translation helpful? Give feedback.
All reactions