diff --git a/README.md b/README.md index e14eee97728d4133d3b4bc7cacddad631e21adce..11e17006f099604f130183d474dc9729aac2bf57 100644 --- a/README.md +++ b/README.md @@ -76,3 +76,27 @@ Example invocation: ```shell sudo ./go-mmproxy -l 0.0.0.0:25577 -4 127.0.0.1:25578 -6 [::1]:25578 --allowed-subnets ./path-prefixes.txt ``` + +## Benchmark + +### Setup + +The benchmark was ran on Dell XPS 9570 with Intel Core i9-8950HK CPU @ 2.90GHz (12 logical cores). The upstream service to which proxy sent traffic was mocked by [bpf-echo](https://github.com/path-network/bpf-echo) server. +Traffic was generated by [tcpkali](https://github.com/satori-com/tcpkali) v1.1.1 . + +The following command was used for load generation in all cases (50 connections, 10s runtime, send PROXYv1 header for each connection, use `PING\r\n` as TCP message): + +``` +tcpkali -c 50 -T 10s -e1 'PROXY TCP4 127.0.0.1 127.0.0.1 \{connection.uid} 25578\r\n' -m 'PING\r\n' 127.0.0.1:1122 +``` + +### Results + +| | ⇅ Mbps | ↓ Mbps | ↑ Mbps | ↓ pkt/s | ↑ pkt/s | +| ----------------------- | --------- | --------- | --------- | --------- | --------- | +| cloudflare/mmproxy | 1524.454 | 756.385 | 768.069 | 70365.9 | 65921.9 | +| go-mmproxy GOMAXPROCS=1 | 7418.312 | 2858.794 | 4559.518 | 262062.7 | 391334.6 | +| go-mmproxy | 45483.233 | 16142.348 | 29340.885 | 1477889.6 | 2518271.5 | +| no proxy | 52640.116 | 22561.129 | 30078.987 | 2065805.4 | 2581621.3 | + + diff --git a/benchmark.png b/benchmark.png new file mode 100644 index 0000000000000000000000000000000000000000..389c0f2d8c9e46e39328ab44b86351e6cca9d0e5 Binary files /dev/null and b/benchmark.png differ