mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 02:35:31 +00:00
README: add aquatic_http and load test section, remove default configs
This commit is contained in:
parent
773494b17b
commit
05ae0d48b6
1 changed files with 56 additions and 86 deletions
142
README.md
142
README.md
|
|
@ -4,8 +4,9 @@ Blazingly fast, multi-threaded BitTorrent tracker written in Rust.
|
||||||
|
|
||||||
Consists of separate executables:
|
Consists of separate executables:
|
||||||
* `aquatic_udp`: UDP BitTorrent tracker with double the throughput of
|
* `aquatic_udp`: UDP BitTorrent tracker with double the throughput of
|
||||||
opentracker
|
opentracker (see benchmarks below)
|
||||||
* `aquatic_ws`: WebTorrent tracker (experimental)
|
* `aquatic_ws`: WebTorrent tracker (experimental)
|
||||||
|
* `aquatic_http`: HTTP BitTorrent tracker (experimental)
|
||||||
|
|
||||||
These are described in detail below, after the general information.
|
These are described in detail below, after the general information.
|
||||||
|
|
||||||
|
|
@ -28,17 +29,16 @@ while network work can be efficiently distributed over multiple threads.
|
||||||
|
|
||||||
- Install Rust with [rustup](https://rustup.rs/) (stable is recommended)
|
- Install Rust with [rustup](https://rustup.rs/) (stable is recommended)
|
||||||
- Install cmake with your package manager (e.g., `apt-get install cmake`)
|
- Install cmake with your package manager (e.g., `apt-get install cmake`)
|
||||||
- For `aquatic_ws` on GNU/Linux, also install the OpenSSL components necessary
|
- For `aquatic_ws` and `aquatic_http` on GNU/Linux, also install the OpenSSL
|
||||||
for dynamic linking (e.g., `apt-get install libssl-dev`)
|
components necessary for dynamic linking (e.g., `apt-get install libssl-dev`)
|
||||||
- Clone the git repository and refer to the next section.
|
- Clone the git repository and refer to the next section.
|
||||||
|
|
||||||
## Compile and run
|
## Compile and run
|
||||||
|
|
||||||
The command line interfaces for `aquatic_udp` and `aquatic_ws` are identical.
|
The command line interfaces for the tracker executables are identical. To run
|
||||||
To run the respective tracker, just run its binary. You can also run any of
|
the respective tracker, just run its binary. You can also run any of the helper
|
||||||
the helper scripts, which will compile the binary for you and pass on any
|
scripts, which will compile the binary for you and pass on any command line
|
||||||
command line parameters. (After compilation, the binaries are found in
|
parameters. (After compilation, the binaries are found in `target/release/`.)
|
||||||
directory `target/release/`.)
|
|
||||||
|
|
||||||
To run with default settings:
|
To run with default settings:
|
||||||
|
|
||||||
|
|
@ -50,6 +50,10 @@ To run with default settings:
|
||||||
./scripts/run-aquatic-ws.sh
|
./scripts/run-aquatic-ws.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./scripts/run-aquatic-http.sh
|
||||||
|
```
|
||||||
|
|
||||||
To print default settings to standard output, pass the "-p" flag to the binary:
|
To print default settings to standard output, pass the "-p" flag to the binary:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
|
@ -60,6 +64,10 @@ To print default settings to standard output, pass the "-p" flag to the binary:
|
||||||
./scripts/run-aquatic-ws.sh -p
|
./scripts/run-aquatic-ws.sh -p
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./scripts/run-aquatic-http.sh -p
|
||||||
|
```
|
||||||
|
|
||||||
To adjust the settings, save the output of the previous command to a file and
|
To adjust the settings, save the output of the previous command to a file and
|
||||||
make your changes. Then run the binaries with a "-c" argument pointing to the
|
make your changes. Then run the binaries with a "-c" argument pointing to the
|
||||||
file, e.g.:
|
file, e.g.:
|
||||||
|
|
@ -72,15 +80,17 @@ file, e.g.:
|
||||||
./scripts/run-aquatic-ws.sh -c "/path/to/aquatic-ws-config.toml"
|
./scripts/run-aquatic-ws.sh -c "/path/to/aquatic-ws-config.toml"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./scripts/run-aquatic-http.sh -c "/path/to/aquatic-http-config.toml"
|
||||||
|
```
|
||||||
|
|
||||||
The configuration file values you will most likely want to adjust are
|
The configuration file values you will most likely want to adjust are
|
||||||
`socket_workers` (number of threads reading from and writing to sockets) and
|
`socket_workers` (number of threads reading from and writing to sockets) and
|
||||||
`address` under the `network` section (listening address). This goes for both
|
`address` under the `network` section (listening address). This goes for all
|
||||||
`aquatic_udp` and `aquatic_ws`.
|
three executables.
|
||||||
|
|
||||||
Some documentation of the various options is available in source code files
|
Some documentation of the various options might be available in source code
|
||||||
`aquatic_udp/src/lib/config.rs` and `aquatic_ws/src/lib/config.rs`. The
|
files `src/lib/config.rs` in the respective tracker crates.
|
||||||
default settings are also included in in this document, under the section for
|
|
||||||
each executable below.
|
|
||||||
|
|
||||||
## Details on protocol-specific executables
|
## Details on protocol-specific executables
|
||||||
|
|
||||||
|
|
@ -96,40 +106,6 @@ except that it:
|
||||||
|
|
||||||
Supports IPv4 and IPv6.
|
Supports IPv4 and IPv6.
|
||||||
|
|
||||||
#### Default configuration:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
socket_workers = 1
|
|
||||||
request_workers = 1
|
|
||||||
|
|
||||||
[network]
|
|
||||||
address = '0.0.0.0:3000'
|
|
||||||
socket_recv_buffer_size = 524288
|
|
||||||
poll_event_capacity = 4096
|
|
||||||
|
|
||||||
[protocol]
|
|
||||||
max_scrape_torrents = 255
|
|
||||||
max_response_peers = 255
|
|
||||||
peer_announce_interval = 900
|
|
||||||
|
|
||||||
[handlers]
|
|
||||||
max_requests_per_iter = 10000
|
|
||||||
channel_recv_timeout_microseconds = 200
|
|
||||||
|
|
||||||
[statistics]
|
|
||||||
interval = 0
|
|
||||||
|
|
||||||
[cleaning]
|
|
||||||
interval = 30
|
|
||||||
max_peer_age = 1200
|
|
||||||
max_connection_age = 300
|
|
||||||
|
|
||||||
[privileges]
|
|
||||||
drop_privileges = false
|
|
||||||
chroot_path = '.'
|
|
||||||
user = 'nobody'
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Benchmarks
|
#### Benchmarks
|
||||||
|
|
||||||
Performance was compared to
|
Performance was compared to
|
||||||
|
|
@ -147,7 +123,8 @@ Server responses per second, best result in bold:
|
||||||
| 6 | __309k__ | 109k |
|
| 6 | __309k__ | 109k |
|
||||||
| 8 | __408k__ | 96k |
|
| 8 | __408k__ | 96k |
|
||||||
|
|
||||||
(See `documents/aquatic-load-test-2020-04-19.pdf` for details.)
|
See `documents/aquatic-load-test-2020-04-19.pdf` for details on benchmark, and
|
||||||
|
end of README for more information about load testing.
|
||||||
|
|
||||||
### aquatic_ws: WebTorrent tracker
|
### aquatic_ws: WebTorrent tracker
|
||||||
|
|
||||||
|
|
@ -162,43 +139,6 @@ exceptions:
|
||||||
successfully used as the tracker for a file transfer between two webtorrent
|
successfully used as the tracker for a file transfer between two webtorrent
|
||||||
peers.
|
peers.
|
||||||
|
|
||||||
#### Default configuration
|
|
||||||
|
|
||||||
```toml
|
|
||||||
socket_workers = 1
|
|
||||||
log_level = 'error'
|
|
||||||
|
|
||||||
[network]
|
|
||||||
address = '0.0.0.0:3000'
|
|
||||||
ipv6_only = false
|
|
||||||
use_tls = false
|
|
||||||
tls_pkcs12_path = ''
|
|
||||||
tls_pkcs12_password = ''
|
|
||||||
poll_event_capacity = 4096
|
|
||||||
poll_timeout_milliseconds = 50
|
|
||||||
websocket_max_message_size = 65536
|
|
||||||
websocket_max_frame_size = 16384
|
|
||||||
|
|
||||||
[protocol]
|
|
||||||
max_scrape_torrents = 255
|
|
||||||
max_offers = 10
|
|
||||||
peer_announce_interval = 120
|
|
||||||
|
|
||||||
[handlers]
|
|
||||||
max_requests_per_iter = 10000
|
|
||||||
channel_recv_timeout_microseconds = 200
|
|
||||||
|
|
||||||
[cleaning]
|
|
||||||
interval = 30
|
|
||||||
max_peer_age = 180
|
|
||||||
max_connection_age = 180
|
|
||||||
|
|
||||||
[privileges]
|
|
||||||
drop_privileges = false
|
|
||||||
chroot_path = '.'
|
|
||||||
user = 'nobody'
|
|
||||||
```
|
|
||||||
|
|
||||||
#### TLS
|
#### TLS
|
||||||
|
|
||||||
To run over TLS (wss protocol), a pkcs12 file (`.pkx`) is needed. It can be
|
To run over TLS (wss protocol), a pkcs12 file (`.pkx`) is needed. It can be
|
||||||
|
|
@ -213,6 +153,36 @@ Enter a password when prompted. Then move `identity.pfx` somewhere suitable,
|
||||||
and enter the path into the tracker configuration field `tls_pkcs12_path`. Set
|
and enter the path into the tracker configuration field `tls_pkcs12_path`. Set
|
||||||
the password in the field `tls_pkcs12_password` and set `use_tls` to true.
|
the password in the field `tls_pkcs12_password` and set `use_tls` to true.
|
||||||
|
|
||||||
|
### aquatic_http: HTTP BitTorrent tracker
|
||||||
|
|
||||||
|
Aims for compatibility with the HTTP BitTorrent protocol, as described
|
||||||
|
[here](https://wiki.theory.org/index.php/BitTorrentSpecification#Tracker_HTTP.2FHTTPS_Protocol),
|
||||||
|
including TLS and scrape request support. There are some exceptions:
|
||||||
|
|
||||||
|
* Doesn't track of the number of torrent downloads (0 is always sent).
|
||||||
|
* Doesn't allow full scrapes, i.e. of all registered info hashes
|
||||||
|
|
||||||
|
`aquatic_http` is a work in progress and hasn't been tested very much yet.
|
||||||
|
|
||||||
|
Please refer to the `aquatic_ws` section for information about setting up TLS.
|
||||||
|
|
||||||
|
## Load testing
|
||||||
|
|
||||||
|
There are two load test binaries. They use the same CLI structure as the
|
||||||
|
trackers, including configuration file generation and loading.
|
||||||
|
|
||||||
|
To load test `aquatic_udp`, start it and then run:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./scripts/run-load-test-udp.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
To load test `aquatic_http`, start it and then run:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./scripts/run-load-test-http.sh
|
||||||
|
```
|
||||||
|
|
||||||
## Trivia
|
## Trivia
|
||||||
|
|
||||||
The tracker is called aquatic because it thrives under a torrent of bits ;-)
|
The tracker is called aquatic because it thrives under a torrent of bits ;-)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue