zhboner / realm

A network relay tool
MIT License
1.54k stars 285 forks source link

benchmark: realm vs gost #54

Closed zephyrchien closed 2 years ago

zephyrchien commented 2 years ago

NO WARRANTY

Data are roughly collected. You should never rely on these results for any serious purpose.

Tool

Realm:

realm -v
Realm 2.0.0 [udp][zero-copy][trust-dns][proxy-protocol][multi-thread]

Gost:

gost -V
gost 3.0.0-beta.2 (go1.18.1 linux/amd64)

Environment

Run these tools in a container:

docker run -it --cpus=0.5 --name=relay bench /bin/bash

We simply limit CPU usage to make sure network would not become the bottleneck during a benchmark. And there is no extra restriction on memory usage.

Command

A(host) => B(docker) => C(docker) => D(host)

A:

iperf3 -c 172.17.0.2 -p 8080 -t 60 -P [1,10,30,50,100]

D:

iperf3 -s -p 5201

TCP

Realm:

realm -l 0.0.0.0:8080 -r 172.17.0.1:5201 -z

Gost:

gost -L tcp://:8080/172.17.0.1:5201 2>/dev/null

WS

Realm:

realm -l 0.0.0.0:8080 -r 172.17.0.3:8080 -b 'ws;host=abc;path=/'
realm -l 0.0.0.0:8080 -r 172.17.0.1:5201 -a 'ws;host=abc;path=/'

Gost:

gost -L tcp://:8080 -F relay+ws://172.17.0.3:8080 2>/dev/null
gost -L relay+ws://:8080/172.17.0.1:5201 2>/dev/null

WSS

Realm:

realm -l 0.0.0.0:8080 -r 172.17.0.3:8080 -b 'ws;host=abc;path=/;tls;insecure;sni=abc'
realm -l 0.0.0.0:8080 -r 172.17.0.1:5201 -a 'ws;host=abc;path=/;tls;servername=abc'

Gost:

gost -L tcp://:8080 -F relay+wss://172.17.0.3:8080 2>/dev/null
gost -L relay+wss://:8080/172.17.0.1:5201 2>/dev/null

Result

TCP:

TCP Bandwidth TCP Memory

WS:

WS Bandwidth WS Memory

WSS:

WSS Bandwidth WSS Memory

OneHappyForever commented 2 years ago

Can you label the colors? Is orange realm and blue gost or vice-versa?

zephyrchien commented 2 years ago

Can you label the colors? Is orange realm and blue gost or vice-versa?

Of course Realm is orange, the faster one.

I simply applied Go/Rust's github color to Gost/Realm:

Gost: #00ADD8 Realm: #DEA584