Skip to content

Commit

Permalink
Merge pull request #163 from greatest-ape/load-test-fixes
Browse files Browse the repository at this point in the history
load tester: refactor, add udp sets, improve docs, add command options; update README
  • Loading branch information
greatest-ape authored Dec 27, 2023
2 parents 3fde7d6 + 0317053 commit 6f9b0fc
Show file tree
Hide file tree
Showing 8 changed files with 368 additions and 205 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ of sub-implementations for different protocols:
[aquatic_http]: ./crates/http
[aquatic_ws]: ./crates/ws

| Name | Protocol | OS requirements |
|----------------|-------------------------------------------|-----------------|
| [aquatic_udp] | BitTorrent over UDP | Unix-like |
| [aquatic_http] | BitTorrent over HTTP, optionally over TLS | Linux 5.8+ |
| [aquatic_ws] | WebTorrent, optionally over TLS | Linux 5.8+ |
| Name | Protocol | OS requirements |
|----------------|-------------------------------------------|--------------------|
| [aquatic_udp] | BitTorrent over UDP | Unix-like |
| [aquatic_http] | BitTorrent over HTTP, optionally over TLS | Linux 5.8 or later |
| [aquatic_ws] | WebTorrent, optionally over TLS | Linux 5.8 or later |

Features at a glance:

Expand All @@ -27,6 +27,7 @@ Features at a glance:
Known users:

- [explodie.org public tracker](https://explodie.org/opentracker.html) (`udp://explodie.org:6969`), typically [serving ~100,000 requests per second](https://explodie.org/tracker-stats.html)
- [tracker.webtorrent.dev](https://tracker.webtorrent.dev) (`wss://tracker.webtorrent.dev`)

## Performance of the UDP implementation

Expand Down
2 changes: 1 addition & 1 deletion crates/load_tester/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aquatic_load_tester"
description = "Load test runner for aquatic BitTorrent tracker"
description = "Automated load testing of aquatic and other BitTorrent trackers (Linux only)"
keywords = ["peer-to-peer", "torrent", "bittorrent"]
version.workspace = true
authors.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/load_tester/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# aquatic_load_tester

Automated load testing of aquatic and other BitTorrent trackers. Linux only.
16 changes: 15 additions & 1 deletion crates/load_tester/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,28 @@ pub mod run;
pub mod set;

use clap::{Parser, Subcommand};
use common::CpuMode;

#[derive(Parser)]
#[command(author, version, about)]
struct Args {
/// How to choose which virtual CPUs to allow trackers and load test
/// executables on
#[arg(long, default_value_t = CpuMode::Split)]
cpu_mode: CpuMode,
/// Minimum number of tracker cpu cores to run load tests for
#[arg(long)]
min_cores: Option<usize>,
/// Maximum number of tracker cpu cores to run load tests for
#[arg(long)]
max_cores: Option<usize>,
#[command(subcommand)]
command: Command,
}

#[derive(Subcommand)]
enum Command {
/// Benchmark UDP BitTorrent trackers aquatic_udp and opentracker
#[cfg(feature = "udp")]
Udp(protocols::udp::UdpCommand),
}
Expand All @@ -23,6 +35,8 @@ fn main() {

match args.command {
#[cfg(feature = "udp")]
Command::Udp(command) => command.run().unwrap(),
Command::Udp(command) => command
.run(args.cpu_mode, args.min_cores, args.max_cores)
.unwrap(),
}
}
Loading

0 comments on commit 6f9b0fc

Please sign in to comment.