From d67ef9804679b29101b34bb3df7cdb4bf4505c5b Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Tue, 19 Nov 2024 13:25:35 +0400 Subject: [PATCH] feat: add configs and manual for bench1 --- README.md | 17 +++++++++++++++++ direct.json | 17 +++++++++++++++++ direct_xray.json | 20 ++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 direct.json create mode 100644 direct_xray.json diff --git a/README.md b/README.md index eec443d..1576c7e 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,23 @@ that is important, I guess (?), in China and Iran. - Get [sing-box](https://github.com/SagerNet/sing-box/releases/latest) and [xray](github.com/XTLS/Xray-core/releases/latest) binaries by downloading from "Releases" or compiling by yourself + +Benchmark 1: +- Install [hyperfine](https://github.com/sharkdp/hyperfine) +- Run `./sing-box run --config direct.json` and `./xray run -c direct_xray.json` on client + (use different terminal tabs/windows, or put one proxy to background with `&`) +- Find some binary file with size about 1.5M and upload it to your server + (because I can not guarantee that I won't delete `Marisa.m4a` used in tests; + it's an audio stream of some video downloaded from YT) +- Run + `hyperfine -m 50 'curl https://...link to the file...' 'curl --proxy socks5://127.0.0.1:2080 https://link' 'curl --proxy socks5://127.0.0.1:2081 https://link'` +- Choose some web site with a small load and no ratelimits that gives an https-redirect + with a small HTML response when accessing it by plain http, like `http://dc09.ru`, + repeat the test replacing the link +- Choose some web site with a heavy load and relatively small HTML landing, like `https://github.com`, + repeat the test replacing the link + +Benchmark 2: - Compile [iperf3 fork with socks5 support](https://github.com/davidBar-On/iperf/tree/issue-1095-socks5-support) by cloning git repo (don't forget that you need branch `issue-1095-socks5-support`, not master!) and running `./configure && make` -- you'll get a built iperf in `./src/iperf3` diff --git a/direct.json b/direct.json new file mode 100644 index 0000000..116d82a --- /dev/null +++ b/direct.json @@ -0,0 +1,17 @@ +{ + "log": { + "disabled": true + }, + "inbounds": [ + { + "type": "socks", + "listen": "127.0.0.1", + "listen_port": 2080 + } + ], + "outbounds": [ + { + "type": "direct" + } + ] +} diff --git a/direct_xray.json b/direct_xray.json new file mode 100644 index 0000000..ddf7053 --- /dev/null +++ b/direct_xray.json @@ -0,0 +1,20 @@ +{ + "log": { + "loglevel": "none" + }, + "inbounds": [ + { + "protocol": "socks", + "listen": "127.0.0.1", + "port": 2081, + "settings": { + "udp": true + } + } + ], + "outbounds": [ + { + "protocol": "freedom" + } + ] +}