From 51fe398708c2737cd3be55c2469fe5faae169ad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Thu, 21 Mar 2024 17:00:00 +0100 Subject: [PATCH 1/4] Update bencher README --- crates/bencher/README.md | 106 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 100 insertions(+), 6 deletions(-) diff --git a/crates/bencher/README.md b/crates/bencher/README.md index 947685e..61d2c01 100644 --- a/crates/bencher/README.md +++ b/crates/bencher/README.md @@ -4,11 +4,105 @@ Automated benchmarking of aquatic and other BitTorrent trackers. Requires Linux 6.0 or later. -## Supported trackers by protocol +Currently, only UDP BitTorrent tracker support is implemented. -### UDP +## UDP -- [aquatic_udp](https://github.com/greatest-ape/aquatic/) -- [opentracker](https://erdgeist.org/arts/software/opentracker/) -- [chihaya](https://github.com/chihaya/chihaya) -- [torrust-tracker](https://github.com/torrust/torrust-tracker) \ No newline at end of file +| Name | Commit | +|-------------------|-----------------------| +| [aquatic_udp] | (use same as bencher) | +| [opentracker] | 110868e | +| [chihaya] | 2f79440 | +| [torrust-tracker] | 47c2fe2 | + +The commits listed are ones known to work. It might be a good idea to first +test with the latest commits for each project, and if they don't seem to work, +revert to the listed commits. + +Chihaya is known to crash under high load. + +[aquatic_udp]: https://github.com/greatest-ape/aquatic/ +[opentracker]: http://erdgeist.org/arts/software/opentracker/ +[chihaya]: https://github.com/chihaya/chihaya +[torrust-tracker]: https://github.com/torrust/torrust-tracker + +### Usage + +Install dependencies. This is done differently for different Linux +distributions. On Debian 12, run: + +```sh +sudo apt-get update +sudo apt-get install -y curl cmake build-essential pkg-config git screen cvs zlib1g zlib1g-dev golang +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +source "$HOME/.cargo/env" +``` + +Optionally install latest Linux kernel. On Debian 12, you can do so from backports: + +```sh +sudo echo "deb http://deb.debian.org/debian bookworm-backports main contrib" >> /etc/apt/sources.list +sudo apt-get update && sudo apt-get install -y linux-image-amd64/bookworm-backports +# You will have to restart to boot into the new kernel +``` + +Compile aquatic_udp, aquatic_udp_load_test and aquatic_udp_bencher: + +```sh +git clone https://github.com/greatest-ape/aquatic.git && cd aquatic +# Optionally enable certain native platform optimizations +. ./scripts/env-native-cpu-without-avx-512 +cargo build --profile "release-debug" -p aquatic_udp --features "io-uring" +cargo build --profile "release-debug" -p aquatic_udp_load_test +cargo build --profile "release-debug" -p aquatic_bencher --features udp +cd .. +``` + +Compile and install opentracker: + +```sh +cvs -d :pserver:cvs@cvs.fefe.de:/cvs -z9 co libowfat +cd libowfat +make +cd .. +git clone git://erdgeist.org/opentracker +cd opentracker +# Optionally enable native platform optimizations +sed -i "s/^OPTS_production=-O3/OPTS_production=-O3 -march=native -mtune=native/g" Makefile +make +sudo cp ./opentracker /usr/local/bin/ +cd .. +``` + +Compile and install chihaya: + +```sh +git clone https://github.com/chihaya/chihaya.git +cd chihaya +go build ./cmd/chihaya +sudo cp ./chihaya /usr/local/bin/ +``` + +Compile and install torrust-tracker: + +```sh +git clone git@github.com:torrust/torrust-tracker.git +cd torrust-tracker +cargo build --release +cp ./target/release/torrust-tracker /usr/local/bin/ +``` + +You might need to raise locked memory limits: + +```sh +ulimit -l 65536 +``` + +Run the bencher: + +```sh +cd aquatic +./target/release-debug/aquatic_bencher udp +# or print info on command line arguments +./target/release-debug/aquatic_bencher udp --help +``` \ No newline at end of file From cc800a8416211670e9c7bd0e7c7051aa6c3ae86a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Thu, 21 Mar 2024 17:04:26 +0100 Subject: [PATCH 2/4] bencher: add 2 threads per core entries for aquatic and opentracker Use low priority to enable skipping them --- crates/bencher/src/protocols/udp.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/crates/bencher/src/protocols/udp.rs b/crates/bencher/src/protocols/udp.rs index d58c232..3c81c9c 100644 --- a/crates/bencher/src/protocols/udp.rs +++ b/crates/bencher/src/protocols/udp.rs @@ -65,13 +65,19 @@ impl UdpCommand { implementations: indexmap! { UdpTracker::Aquatic => vec![ AquaticUdpRunner::with_mio(1, Priority::High), + // Allow running two workers per core for aquatic and + // opentracker. Skip this priority if testing on a + // virtual machine + AquaticUdpRunner::with_mio(2, Priority::Low), ], UdpTracker::AquaticIoUring => vec![ AquaticUdpRunner::with_io_uring(1, Priority::High), + AquaticUdpRunner::with_io_uring(2, Priority::Low), ], UdpTracker::OpenTracker => vec![ OpenTrackerUdpRunner::new(0, Priority::Medium), // Handle requests within event loop OpenTrackerUdpRunner::new(1, Priority::High), + OpenTrackerUdpRunner::new(2, Priority::Low), ], UdpTracker::Chihaya => vec![ ChihayaUdpRunner::new(), @@ -89,12 +95,15 @@ impl UdpCommand { implementations: indexmap! { UdpTracker::Aquatic => vec![ AquaticUdpRunner::with_mio(2, Priority::High), + AquaticUdpRunner::with_mio(4, Priority::Low), ], UdpTracker::AquaticIoUring => vec![ AquaticUdpRunner::with_io_uring(2, Priority::High), + AquaticUdpRunner::with_io_uring(4, Priority::Low), ], UdpTracker::OpenTracker => vec![ OpenTrackerUdpRunner::new(2, Priority::High), + OpenTrackerUdpRunner::new(4, Priority::Low), ], UdpTracker::Chihaya => vec![ ChihayaUdpRunner::new(), @@ -112,12 +121,15 @@ impl UdpCommand { implementations: indexmap! { UdpTracker::Aquatic => vec![ AquaticUdpRunner::with_mio(4, Priority::High), + AquaticUdpRunner::with_mio(8, Priority::Low), ], UdpTracker::AquaticIoUring => vec![ AquaticUdpRunner::with_io_uring(4, Priority::High), + AquaticUdpRunner::with_io_uring(8, Priority::Low), ], UdpTracker::OpenTracker => vec![ OpenTrackerUdpRunner::new(4, Priority::High), + OpenTrackerUdpRunner::new(8, Priority::Low), ], UdpTracker::Chihaya => vec![ ChihayaUdpRunner::new(), @@ -135,12 +147,15 @@ impl UdpCommand { implementations: indexmap! { UdpTracker::Aquatic => vec![ AquaticUdpRunner::with_mio(6, Priority::High), + AquaticUdpRunner::with_mio(12, Priority::Low), ], UdpTracker::AquaticIoUring => vec![ AquaticUdpRunner::with_io_uring(6, Priority::High), + AquaticUdpRunner::with_io_uring(12, Priority::Low), ], UdpTracker::OpenTracker => vec![ OpenTrackerUdpRunner::new(6, Priority::High), + OpenTrackerUdpRunner::new(12, Priority::Low), ], UdpTracker::Chihaya => vec![ ChihayaUdpRunner::new(), @@ -158,12 +173,15 @@ impl UdpCommand { implementations: indexmap! { UdpTracker::Aquatic => vec![ AquaticUdpRunner::with_mio(8, Priority::High), + AquaticUdpRunner::with_mio(16, Priority::Low), ], UdpTracker::AquaticIoUring => vec![ AquaticUdpRunner::with_io_uring(8, Priority::High), + AquaticUdpRunner::with_io_uring(16, Priority::Low), ], UdpTracker::OpenTracker => vec![ OpenTrackerUdpRunner::new(8, Priority::High), + OpenTrackerUdpRunner::new(16, Priority::Low), ], UdpTracker::Chihaya => vec![ ChihayaUdpRunner::new(), @@ -181,12 +199,15 @@ impl UdpCommand { implementations: indexmap! { UdpTracker::Aquatic => vec![ AquaticUdpRunner::with_mio(12, Priority::High), + AquaticUdpRunner::with_mio(24, Priority::Low), ], UdpTracker::AquaticIoUring => vec![ AquaticUdpRunner::with_io_uring(12, Priority::High), + AquaticUdpRunner::with_io_uring(24, Priority::Low), ], UdpTracker::OpenTracker => vec![ OpenTrackerUdpRunner::new(12, Priority::High), + OpenTrackerUdpRunner::new(24, Priority::Low), ], UdpTracker::Chihaya => vec![ ChihayaUdpRunner::new(), @@ -204,12 +225,15 @@ impl UdpCommand { implementations: indexmap! { UdpTracker::Aquatic => vec![ AquaticUdpRunner::with_mio(16, Priority::High), + AquaticUdpRunner::with_mio(32, Priority::Low), ], UdpTracker::AquaticIoUring => vec![ AquaticUdpRunner::with_io_uring(16, Priority::High), + AquaticUdpRunner::with_io_uring(32, Priority::Low), ], UdpTracker::OpenTracker => vec![ OpenTrackerUdpRunner::new(16, Priority::High), + OpenTrackerUdpRunner::new(32, Priority::Low), ], UdpTracker::Chihaya => vec![ ChihayaUdpRunner::new(), From 5ef2ea2745ee2860df4ce1f162253faac653e0aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Thu, 21 Mar 2024 17:07:17 +0100 Subject: [PATCH 3/4] bencher: update README --- crates/bencher/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/bencher/README.md b/crates/bencher/README.md index 61d2c01..332b780 100644 --- a/crates/bencher/README.md +++ b/crates/bencher/README.md @@ -105,4 +105,8 @@ cd aquatic ./target/release-debug/aquatic_bencher udp # or print info on command line arguments ./target/release-debug/aquatic_bencher udp --help -``` \ No newline at end of file +``` + +If you're running the load test on a virtual machine / virtual server, consider +passing `--min-priority medium --cpu-mode subsequent-one-per-pair` for fairer +results. From 78d545462e67d6ee0ab63745a51f7498656dc0da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Thu, 21 Mar 2024 17:12:38 +0100 Subject: [PATCH 4/4] README: add "Support applications" section --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index b1446ae..4150dd9 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,18 @@ More benchmark details are available [here](./documents/aquatic-udp-load-test-20 Please refer to the README pages for the respective implementations listed in the table above. +## Support applications + +There are also a few support applications: + +- [aquatic_udp_load_test](./crates/udp_load_test/) - UDP BitTorrent tracker load tester +- [aquatic_http_load_test](./crates/http_load_test/) - HTTP BitTorrent tracker load tester +- [aquatic_ws_load_test](./crates/ws_load_test/) - WebTorrent tracker load tester + +and + +- [aquatic_bencher](./crates/bencher/) - automated tracker benchmarking + ## Copyright and license Copyright (c) Joakim FrostegÄrd