fast-socks5 icon indicating copy to clipboard operation
fast-socks5 copied to clipboard

Benchmarks (fast-socks5 vs hev-socks5-server)

Open heiher opened this issue 1 year ago • 1 comments

It's great to see more projects in Rust, I also like Rust. I wrote a socks5 server in C, and just out of curiosity, I compared their performance. (fast-socks5 vs hev-socks5-server)

The hardware is an AMD Ryzen 9 7950X 16-Core Processor, bandwidth was measured using iperf3, and the iperf3 client was proxied through socks5 using proxychains-ng.

# hev-socks5-server
bin/hev-socks5-server conf/main.yml # workers: 32

# fast-socks5
cargo run -r --example server -- --listen-addr 127.0.0.1:1080 no-auth

# iperf3 server
iperf3 -s

# download (1-thread)
proxychains iperf3 -c 127.0.0.1 -R

# download (10-thread)
proxychains iperf3 -c 127.0.0.1 -R -P 10

# upload (1-thread)
proxychains iperf3 -c 127.0.0.1

# upload (10-thread)
proxychains iperf3 -c 127.0.0.1 -P 10

The test focused on transfer speed, CPU usage and memory usage.

hev-socks5-server Speed (Gbits/s) CPU usage (%) Memory usage (MB)
Download (1-thread) 46.7 54 1.8
Download (10-thread) 274 380 1.8
Upload (1-thread) 46.7 54 1.8
Upload (10-thread) 288 430 1.8
fast-socks5 Speed (Gbits/s) CPU usage (%) Memory usage (MB)
Download (1-thread) 38.7 92 3.2
Download (10-thread) 121 858 3.5
Upload (1-thread) 28.9 64 3.2
Upload (10-thread) 128 882 3.5

heiher avatar Apr 19 '24 12:04 heiher

Hey @heiher

Thank you for posting this comparison. I've developed this library a while ago, and I think a lot of it can now be improved, especially on the UX dev side.

dizda avatar Apr 22 '24 06:04 dizda