4 个版本 (破坏性)
0.9.0 | 2024 年 5 月 3 日 |
---|---|
0.8.0 | 2023 年 3 月 18 日 |
0.2.0 | 2022 年 3 月 26 日 |
0.1.0 | 2020 年 9 月 13 日 |
#14 in #udp-server
每月 62 次下载
用于 2 个 仓库
230KB
5K SLoC
aquatic_udp: 高性能开源 UDP BitTorrent 跟踪器
适用于类 Unix 操作系统的高性能开源 UDP BitTorrent 跟踪器。
主要功能
- 多线程设计,可处理大量流量
- 所有数据存储在内存中(无需数据库)
- 支持 IPv4 和 IPv6
- 支持禁止/允许信息散列
- Prometheus 指标
- 自动 CI 测试完整文件传输
已知用户
- explodie.org 公共跟踪器 (
udp://explodie.org:6969
), 通常 每秒处理 ~100,000 个请求
这是 aquatic 系列中最成熟的应用。我认为它完全适用于生产使用。
性能
更多基准测试细节请见 此处。
用法
编译
- 使用 rustup 安装 Rust(建议使用最新稳定版本)
- 使用您的包管理器安装构建依赖项(例如,
apt-get install cmake build-essential
) - 克隆此 Git 仓库并构建应用程序
git clone https://github.com/greatest-ape/aquatic.git && cd aquatic
# Recommended: tell Rust to enable support for all SIMD extensions present on
# current CPU except for those relating to AVX-512. (If you run a processor
# that doesn't clock down when using AVX-512, you can enable those instructions
# too.)
. ./scripts/env-native-cpu-without-avx-512
cargo build --release -p aquatic_udp
配置和运行
生成配置文件
./target/release/aquatic_udp -p > "aquatic-udp-config.toml"
对文件进行必要的调整。您可能需要调整 address
(监听地址)部分下的 network
。
完成后,启动应用程序
./target/release/aquatic_udp -c "aquatic-udp-config.toml"
如果您的服务器指向域名 example.com
,并且您已将跟踪器配置为在端口 3000 上运行,则人们现在可以通过将 URL udp://example.com:3000
添加到他们的 torrent 文件或 magnet 链接来使用它。
负载测试
提供了一种负载测试应用程序。它支持以类似于跟踪应用程序的方式生成和加载配置文件。
启动跟踪器后,运行负载测试器
. ./scripts/env-native-cpu-without-avx-512 # Optional
cargo run --release -p aquatic_udp_load_test -- --help
详细信息
- 忽略在公告请求中发送的IP地址。始终使用数据包源IP。
- 不跟踪种子文件的下载次数(始终发送0)。
版权和许可
版权(c)Joakim Frostegård
在Apache License,版本2.0的条款下分发。有关详细信息,请参阅仓库根目录中的LICENSE
文件。
依赖关系
~12–28MB
~380K SLoC