mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 09:45:31 +00:00
Merge pull request #165 from greatest-ape/bench-setup
Improve udp benchmarking
This commit is contained in:
commit
7d17213a20
5 changed files with 65 additions and 54 deletions
|
|
@ -1,3 +1,3 @@
|
|||
# aquatic_load_tester
|
||||
# aquatic_bencher
|
||||
|
||||
Automated load testing of aquatic and other BitTorrent trackers. Linux only.
|
||||
Automated benchmarking of aquatic and other BitTorrent trackers. Linux only.
|
||||
|
|
@ -86,8 +86,7 @@ impl UdpCommand {
|
|||
OpenTrackerUdpRunner::new(2),
|
||||
],
|
||||
UdpTracker::Chihaya => vec![
|
||||
ChihayaUdpRunner::new(None),
|
||||
ChihayaUdpRunner::new(Some(2)),
|
||||
ChihayaUdpRunner::new(),
|
||||
],
|
||||
},
|
||||
load_test_runs: simple_load_test_runs(cpu_mode, &[1, 2, 4, 6]),
|
||||
|
|
@ -104,8 +103,7 @@ impl UdpCommand {
|
|||
OpenTrackerUdpRunner::new(4),
|
||||
],
|
||||
UdpTracker::Chihaya => vec![
|
||||
ChihayaUdpRunner::new(None),
|
||||
ChihayaUdpRunner::new(Some(4)),
|
||||
ChihayaUdpRunner::new(),
|
||||
],
|
||||
},
|
||||
load_test_runs: simple_load_test_runs(cpu_mode, &[1, 2, 4, 6]),
|
||||
|
|
@ -122,8 +120,7 @@ impl UdpCommand {
|
|||
OpenTrackerUdpRunner::new(6),
|
||||
],
|
||||
UdpTracker::Chihaya => vec![
|
||||
ChihayaUdpRunner::new(None),
|
||||
ChihayaUdpRunner::new(Some(6)),
|
||||
ChihayaUdpRunner::new(),
|
||||
],
|
||||
},
|
||||
load_test_runs: simple_load_test_runs(cpu_mode, &[4, 6, 8]),
|
||||
|
|
@ -140,8 +137,7 @@ impl UdpCommand {
|
|||
OpenTrackerUdpRunner::new(8),
|
||||
],
|
||||
UdpTracker::Chihaya => vec![
|
||||
ChihayaUdpRunner::new(None),
|
||||
ChihayaUdpRunner::new(Some(8)),
|
||||
ChihayaUdpRunner::new(),
|
||||
],
|
||||
},
|
||||
load_test_runs: simple_load_test_runs(cpu_mode, &[4, 6, 8]),
|
||||
|
|
@ -150,8 +146,7 @@ impl UdpCommand {
|
|||
implementations: indexmap! {
|
||||
UdpTracker::Aquatic => vec![
|
||||
AquaticUdpRunner::new(5, 1),
|
||||
AquaticUdpRunner::new(6, 1),
|
||||
AquaticUdpRunner::new(9, 1),
|
||||
AquaticUdpRunner::new(10, 1),
|
||||
AquaticUdpRunner::new(4, 2),
|
||||
AquaticUdpRunner::new(8, 2),
|
||||
],
|
||||
|
|
@ -159,10 +154,6 @@ impl UdpCommand {
|
|||
OpenTrackerUdpRunner::new(6),
|
||||
OpenTrackerUdpRunner::new(12),
|
||||
],
|
||||
UdpTracker::Chihaya => vec![
|
||||
ChihayaUdpRunner::new(None),
|
||||
ChihayaUdpRunner::new(Some(12)),
|
||||
],
|
||||
},
|
||||
load_test_runs: simple_load_test_runs(cpu_mode, &[4, 6, 8, 12]),
|
||||
},
|
||||
|
|
@ -170,7 +161,6 @@ impl UdpCommand {
|
|||
implementations: indexmap! {
|
||||
UdpTracker::Aquatic => vec![
|
||||
AquaticUdpRunner::new(7, 1),
|
||||
AquaticUdpRunner::new(8, 1),
|
||||
AquaticUdpRunner::new(14, 1),
|
||||
AquaticUdpRunner::new(6, 2),
|
||||
AquaticUdpRunner::new(12, 2),
|
||||
|
|
@ -179,10 +169,6 @@ impl UdpCommand {
|
|||
OpenTrackerUdpRunner::new(8),
|
||||
OpenTrackerUdpRunner::new(16),
|
||||
],
|
||||
UdpTracker::Chihaya => vec![
|
||||
ChihayaUdpRunner::new(None),
|
||||
ChihayaUdpRunner::new(Some(16)),
|
||||
],
|
||||
},
|
||||
load_test_runs: simple_load_test_runs(cpu_mode, &[4, 8, 12]),
|
||||
},
|
||||
|
|
@ -190,46 +176,39 @@ impl UdpCommand {
|
|||
implementations: indexmap! {
|
||||
UdpTracker::Aquatic => vec![
|
||||
AquaticUdpRunner::new(11, 1),
|
||||
AquaticUdpRunner::new(12, 1),
|
||||
AquaticUdpRunner::new(22, 1),
|
||||
AquaticUdpRunner::new(10, 2),
|
||||
AquaticUdpRunner::new(20, 2),
|
||||
AquaticUdpRunner::new(9, 3),
|
||||
AquaticUdpRunner::new(18, 3),
|
||||
AquaticUdpRunner::new(8, 4),
|
||||
AquaticUdpRunner::new(16, 4),
|
||||
],
|
||||
UdpTracker::OpenTracker => vec![
|
||||
OpenTrackerUdpRunner::new(12),
|
||||
OpenTrackerUdpRunner::new(24),
|
||||
],
|
||||
UdpTracker::Chihaya => vec![
|
||||
ChihayaUdpRunner::new(None),
|
||||
ChihayaUdpRunner::new(Some(24)),
|
||||
],
|
||||
},
|
||||
load_test_runs: simple_load_test_runs(cpu_mode, &[4, 8, 12, 16]),
|
||||
load_test_runs: simple_load_test_runs(cpu_mode, &[8, 12, 16]),
|
||||
},
|
||||
16 => SetConfig {
|
||||
implementations: indexmap! {
|
||||
UdpTracker::Aquatic => vec![
|
||||
AquaticUdpRunner::new(15, 1),
|
||||
AquaticUdpRunner::new(30, 1),
|
||||
AquaticUdpRunner::new(14, 2),
|
||||
AquaticUdpRunner::new(28, 2),
|
||||
AquaticUdpRunner::new(13, 3),
|
||||
AquaticUdpRunner::new(26, 3),
|
||||
AquaticUdpRunner::new(12, 4),
|
||||
AquaticUdpRunner::new(24, 4),
|
||||
AquaticUdpRunner::new(11, 5),
|
||||
AquaticUdpRunner::new(22, 5),
|
||||
],
|
||||
UdpTracker::OpenTracker => vec![
|
||||
OpenTrackerUdpRunner::new(16),
|
||||
OpenTrackerUdpRunner::new(32),
|
||||
],
|
||||
UdpTracker::Chihaya => vec![
|
||||
ChihayaUdpRunner::new(None),
|
||||
ChihayaUdpRunner::new(Some(32)),
|
||||
],
|
||||
},
|
||||
load_test_runs: simple_load_test_runs(cpu_mode, &[4, 8, 12, 16]),
|
||||
load_test_runs: simple_load_test_runs(cpu_mode, &[8, 12, 16]),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
@ -266,6 +245,7 @@ impl ProcessRunner for AquaticUdpRunner {
|
|||
|
||||
c.socket_workers = self.socket_workers;
|
||||
c.swarm_workers = self.swarm_workers;
|
||||
c.protocol.max_response_peers = 50;
|
||||
|
||||
let c = toml::to_string_pretty(&c)?;
|
||||
|
||||
|
|
@ -335,13 +315,11 @@ impl ProcessRunner for OpenTrackerUdpRunner {
|
|||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
struct ChihayaUdpRunner {
|
||||
gomaxprocs: Option<usize>,
|
||||
}
|
||||
struct ChihayaUdpRunner;
|
||||
|
||||
impl ChihayaUdpRunner {
|
||||
fn new(gomaxprocs: Option<usize>) -> Rc<dyn ProcessRunner<Command = UdpCommand>> {
|
||||
Rc::new(Self { gomaxprocs })
|
||||
fn new() -> Rc<dyn ProcessRunner<Command = UdpCommand>> {
|
||||
Rc::new(Self)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -363,33 +341,26 @@ impl ProcessRunner for ChihayaUdpRunner {
|
|||
udp:
|
||||
addr: "127.0.0.1:3000"
|
||||
private_key: "abcdefghijklmnopqrst"
|
||||
max_numwant: 50
|
||||
default_numwant: 50
|
||||
storage:
|
||||
name: "memory"
|
||||
"#,
|
||||
)?;
|
||||
|
||||
let mut c = Command::new("taskset");
|
||||
|
||||
let mut c = c
|
||||
Ok(Command::new("taskset")
|
||||
.arg("--cpu-list")
|
||||
.arg(vcpus.as_cpu_list())
|
||||
.arg(&command.chihaya)
|
||||
.arg("--config")
|
||||
.arg(tmp_file.path())
|
||||
.stdout(Stdio::piped())
|
||||
.stderr(Stdio::piped());
|
||||
|
||||
if let Some(gomaxprocs) = self.gomaxprocs {
|
||||
c = c.env("GOMAXPROCS", gomaxprocs.to_string());
|
||||
}
|
||||
|
||||
Ok(c.spawn()?)
|
||||
.stderr(Stdio::piped())
|
||||
.spawn()?)
|
||||
}
|
||||
|
||||
fn keys(&self) -> IndexMap<String, String> {
|
||||
indexmap! {
|
||||
"GOMAXPROCS".to_string() => format!("{:?}", self.gomaxprocs),
|
||||
}
|
||||
Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -412,7 +383,7 @@ impl ProcessRunner for AquaticUdpLoadTestRunner {
|
|||
c.workers = self.workers as u8;
|
||||
c.duration = 60;
|
||||
|
||||
c.requests.weight_connect = 100;
|
||||
c.requests.weight_connect = 0;
|
||||
c.requests.weight_announce = 100;
|
||||
c.requests.weight_scrape = 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -84,6 +84,8 @@ impl<C> RunConfig<C> {
|
|||
::std::thread::sleep(Duration::from_secs(1));
|
||||
}
|
||||
|
||||
// Note: a more advanced version tracking threads too would add argument
|
||||
// "-L" and add "comm" to output format list
|
||||
let tracker_process_stats_res = Command::new("ps")
|
||||
.arg("-p")
|
||||
.arg(tracker.0.id().to_string())
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ impl Default for Config {
|
|||
socket_workers: 1,
|
||||
swarm_workers: 1,
|
||||
log_level: LogLevel::Error,
|
||||
worker_channel_size: 1024 * 16,
|
||||
worker_channel_size: 1024 * 128,
|
||||
request_channel_recv_timeout_ms: 100,
|
||||
network: NetworkConfig::default(),
|
||||
protocol: ProtocolConfig::default(),
|
||||
|
|
|
|||
38
scripts/bench/setup-udp-bookworm.sh
Executable file
38
scripts/bench/setup-udp-bookworm.sh
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
#!/bin/bash
|
||||
# Prepare for running aquatic_bench for UDP on Debian 12
|
||||
|
||||
# Install dependencies
|
||||
sudo apt-get update && apt-get upgrade -y
|
||||
sudo apt-get install -y curl vim htop screen 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"
|
||||
|
||||
# Build aquatic
|
||||
. ./scripts/env-native-cpu-without-avx-512
|
||||
cargo build --profile "release-debug" -p aquatic_udp
|
||||
cargo build --profile "release-debug" -p aquatic_udp_load_test
|
||||
cargo build --profile "release-debug" -p aquatic_bencher --features udp
|
||||
|
||||
cd $HOME
|
||||
mkdir -p projects
|
||||
cd projects
|
||||
|
||||
# Install opentracker
|
||||
cvs -d :pserver:cvs@cvs.fefe.de:/cvs -z9 co libowfat
|
||||
cd libowfat
|
||||
make
|
||||
cd ..
|
||||
git clone git://erdgeist.org/opentracker
|
||||
cd opentracker
|
||||
sed -i "s/^OPTS_production=-O3/OPTS_production=-O3 -march=native -mtune=native/g" Makefile
|
||||
sed -i "s/if \(numwant > 200\) numwant = 200/if (numwant > 50) numwant = 50/g" ot_udp.c
|
||||
make
|
||||
sudo cp ./opentracker /usr/local/bin/
|
||||
cd ..
|
||||
|
||||
# Install chihaya
|
||||
git clone https://github.com/chihaya/chihaya.git
|
||||
cd chihaya
|
||||
go build ./cmd/chihaya
|
||||
sudo cp ./chihaya /usr/local/bin/
|
||||
cd ..
|
||||
Loading…
Add table
Add a link
Reference in a new issue