Comparing sing-box and xray speed
Find a file
2024-11-18 23:00:54 +04:00
bench_curl_direct.txt initial commit 2024-11-18 21:43:31 +04:00
bench_iperf_noproxy.txt refactor: rename iperf_direct->iperf_noproxy; cleanup readme 2024-11-18 23:00:54 +04:00
bench_sb_socks.txt initial commit 2024-11-18 21:43:31 +04:00
bench_sb_trojan.txt initial commit 2024-11-18 21:43:31 +04:00
bench_sb_trojan_fail.txt initial commit 2024-11-18 21:43:31 +04:00
bench_sb_vless.txt initial commit 2024-11-18 21:43:31 +04:00
bench_xray_socks.txt initial commit 2024-11-18 21:43:31 +04:00
bench_xray_trojan.txt initial commit 2024-11-18 21:43:31 +04:00
bench_xray_vless.txt initial commit 2024-11-18 21:43:31 +04:00
cert.pem initial commit 2024-11-18 21:43:31 +04:00
config.json initial commit 2024-11-18 21:43:31 +04:00
config_xray.json initial commit 2024-11-18 21:43:31 +04:00
key.pem initial commit 2024-11-18 21:43:31 +04:00
README.md refactor: rename iperf_direct->iperf_noproxy; cleanup readme 2024-11-18 23:00:54 +04:00
server.json initial commit 2024-11-18 21:43:31 +04:00
server_xray.json initial commit 2024-11-18 21:43:31 +04:00

sing-box vs xray

An attempt on benchmarking these two multi-protocol proxying frameworks. It's reproducible, configs are not redacted, I even uploaded self-signed TLS cert+key, client commands are shown in bench_*.txt files. All you need is iperf3 on client and server, hyperfine on client, xray and sing-box binaries (take from "Releases" or compile by yourself) placed on client and server.

Results in a nutshell: (TODO)

hyperfine, curl, direct outbound

File: bench_curl_direct.txt

Measurement of execution time of curl. Shows overhead of a proxying software.

Proxies are set up to accept requests by SOCKSv5 and forward directly to net.

units: ms (less is better)

~1.5M binary file over https from dc09.ru

proxy min avg max
no proxy 383.3 477.2 697.7
sing-box 376.4 478.6 681.2
xray 374.2 467.7 662.8

162 bytes HTML over plain http from dc09.ru

proxy min avg max
no proxy 51.0 60.5 81.7
sing-box 49.1 62.2 69.9
xray 51.2 61.6 76.4

~150K HTML over https from github.com

proxy min avg max
no proxy 365.3 402.1 449.8
sing-box 338.6 390.5 445.5
xray 342.3 390.8 426.0

iperf3, proxied outbound

Measurement of bandwidth with iperf3. Shows processing speed of a proxying software.

Client proxy (sing-box or xray, specified by a table column) is connected to SOCKSv5, Trojan or VLESS inbound on dc09.ru; server proxy on dc09.ru is either sing-box or xray (heading before a table), accepts requests on all 3 inbounds; iperf3 server is on the same host as a server proxy.

units: Mbit/s (more is better)

no proxy

File: bench_iperf_noproxy.txt

sender 93.7 Mbit/s (receiver 91.4 Mbit/s)

server is sing-box

File: bench_sb_*.txt

protocol sing-box xray client
SOCKSv5 102.0 (91.3) 102.0 (91.3)
Trojan 101.3 (91.0) 100.5 (90.6)
VLESS 101.3 (91.3) 101.5 (90.7)

server is xray

File: bench_xray_*.txt

protocol sing-box xray client
SOCKSv5 101.5 (91.3) 103.0 (91.4)
Trojan 100.1 (90.0) 100.5 (90.6)
VLESS 99.6 (91.1) 102.0 (91.1)