22
33We have two types of benchmarking:
44
5- - E2E benchmarking running the service (HTTP or UDP tracker) .
5+ - E2E benchmarking running the UDP tracker.
66- Internal torrents repository benchmarking.
77
88## E2E benchmarking
99
1010We are using the scripts provided by [ aquatic] ( https://github.com/greatest-ape/aquatic ) .
1111
12- Installing both commands:
12+ How to install both commands:
1313
1414``` console
15- cargo install aquatic_udp_load_test
16- cargo install aquatic_http_load_test
15+ cargo install aquatic_udp_load_test && cargo install aquatic_http_load_test
16+ ```
17+
18+ You can also clone and build the repos. It's the way used for the results shown
19+ in this documentation.
20+
21+ ``` console
22+ git clone [email protected] :greatest-ape/aquatic.git 23+ cd aquatic
24+ cargo build --release -p aquatic_udp_load_test
1725```
1826
1927### Run UDP load test
2028
21- Run the tracker with UDP service enabled on port 3000 and set log level to ` error ` .
29+ Run the tracker with UDP service enabled and other services disabled and set log level to ` error ` .
2230
2331``` toml
2432log_level = " error"
2533
2634[[udp_trackers ]]
27- bind_address = " 0.0.0.0:3000"
2835enabled = true
2936```
3037
38+ Build and run the tracker:
39+
40+ ``` console
41+ cargo build --release
42+ TORRUST_TRACKER_PATH_CONFIG="./share/default/config/tracker.udp.benchmarking.toml" ./target/release/torrust-tracker
43+ ```
44+
3145Run the load test with:
3246
3347``` console
34- aquatic_udp_load_test
48+ ./target/release/ aquatic_udp_load_test
3549```
3650
51+ > NOTICE: You need to modify the port in the ` udp_load_test ` crate to use ` 6969 ` and rebuild.
52+
3753Output:
3854
3955``` output
4056Starting client with config: Config {
41- server_address: 127.0.0.1:3000 ,
57+ server_address: 127.0.0.1:6969 ,
4258 log_level: Error,
4359 workers: 1,
4460 duration: 0,
61+ summarize_last: 0,
62+ extra_statistics: true,
4563 network: NetworkConfig {
4664 multiple_client_ipv4s: true,
47- first_port: 45000,
48- poll_timeout: 276,
49- poll_event_capacity: 2877,
50- recv_buffer: 6000000,
65+ sockets_per_worker: 4,
66+ recv_buffer: 8000000,
5167 },
5268 requests: RequestConfig {
53- number_of_torrents: 10000,
54- scrape_max_torrents: 50,
55- weight_connect: 0,
56- weight_announce: 100,
69+ number_of_torrents: 1000000,
70+ number_of_peers: 2000000,
71+ scrape_max_torrents: 10,
72+ announce_peers_wanted: 30,
73+ weight_connect: 50,
74+ weight_announce: 50,
5775 weight_scrape: 1,
58- torrent_gamma_shape: 0.2,
59- torrent_gamma_scale: 100.0,
60- peer_seeder_probability: 0.25,
61- additional_request_probability: 0.5,
76+ peer_seeder_probability: 0.75,
6277 },
6378}
6479
65- Requests out: 32632.43 /second
66- Responses in: 24239.33 /second
67- - Connect responses: 7896.91
68- - Announce responses: 16327.01
69- - Scrape responses: 15.40
80+ Requests out: 398367.11 /second
81+ Responses in: 358530.40 /second
82+ - Connect responses: 177567.60
83+ - Announce responses: 177508.08
84+ - Scrape responses: 3454.72
7085 - Error responses: 0.00
71- Peers per announce response: 33.10
86+ Peers per announce response: 0.00
87+ Announce responses per info hash:
88+ - p10: 1
89+ - p25: 1
90+ - p50: 1
91+ - p75: 1
92+ - p90: 2
93+ - p95: 3
94+ - p99: 105
95+ - p99.9: 289
96+ - p100: 361
7297```
7398
74- ### Run HTTP load test
75-
76- Run the tracker with UDP service enabled on port 3000 and set log level to ` error ` .
77-
78- ``` toml
79- [[udp_trackers ]]
80- bind_address = " 0.0.0.0:3000"
81- enabled = true
82- ```
83-
84- Run the load test with:
85-
86- ``` console
87- aquatic_http_load_test
88- ```
89-
90- Output:
99+ > IMPORTANT: The performance of th Torrust UDP Tracker is drastically decreased with these log levels: ` info ` , ` debug ` , ` trace ` .
91100
92101``` output
93- Starting client with config: Config {
94- server_address: 127.0.0.1:3000,
95- log_level: Error,
96- num_workers: 1,
97- num_connections: 128,
98- connection_creation_interval_ms: 10,
99- url_suffix: "",
100- duration: 0,
101- keep_alive: true,
102- torrents: TorrentConfig {
103- number_of_torrents: 10000,
104- peer_seeder_probability: 0.25,
105- weight_announce: 5,
106- weight_scrape: 0,
107- torrent_gamma_shape: 0.2,
108- torrent_gamma_scale: 100.0,
109- },
110- cpu_pinning: CpuPinningConfigDesc {
111- active: false,
112- direction: Descending,
113- hyperthread: System,
114- core_offset: 0,
115- },
116- }
102+ Requests out: 40719.21/second
103+ Responses in: 33762.72/second
104+ - Connect responses: 16732.76
105+ - Announce responses: 16692.98
106+ - Scrape responses: 336.98
107+ - Error responses: 0.00
108+ Peers per announce response: 0.00
109+ Announce responses per info hash:
110+ - p10: 1
111+ - p25: 1
112+ - p50: 1
113+ - p75: 1
114+ - p90: 7
115+ - p95: 14
116+ - p99: 27
117+ - p99.9: 35
118+ - p100: 45
117119```
118120
119121### Comparing UDP tracker with other Rust implementations
120122
121- #### Torrust UDP Tracker
122-
123- Running the tracker:
124-
125- ``` console
126- [email protected] :torrust/torrust-tracker.git127- cd torrust-tracker
128- cargo build --release
129- TORRUST_TRACKER_PATH_CONFIG="./share/default/config/tracker.udp.benchmarking.toml" ./target/release/torrust-tracker
130- ```
131-
132- Running the test: ` aquatic_udp_load_test ` .
133-
134- ``` output
135- Requests out: 13075.56/second
136- Responses in: 12058.38/second
137- - Connect responses: 1017.18
138- - Announce responses: 11035.00
139- - Scrape responses: 6.20
140- - Error responses: 0.00
141- Peers per announce response: 41.13
142- ```
143-
144123#### Aquatic UDP Tracker
145124
146125Running the tracker:
@@ -149,29 +128,44 @@ Running the tracker:
149128git clone [email protected] :greatest-ape/aquatic.git 150129cd aquatic
151130cargo build --release -p aquatic_udp
152- ./target/release/aquatic_udp -c "aquatic-udp-config.toml"
131+ ./target/release/aquatic_udp -p > "aquatic-udp-config.toml"
153132./target/release/aquatic_udp -c "aquatic-udp-config.toml"
154133```
155134
156- Running the test: ` aquatic_udp_load_test ` .
135+ Run the load test with:
136+
137+ ``` console
138+ ./target/release/aquatic_udp_load_test
139+ ```
157140
158141``` output
159- Requests out: 383873.14 /second
160- Responses in: 383440.35 /second
161- - Connect responses: 429.19
162- - Announce responses: 379249.22
163- - Scrape responses: 3761.93
142+ Requests out: 432896.42 /second
143+ Responses in: 389577.70 /second
144+ - Connect responses: 192864.02
145+ - Announce responses: 192817.55
146+ - Scrape responses: 3896.13
164147 - Error responses: 0.00
165- Peers per announce response: 15.33
148+ Peers per announce response: 21.55
149+ Announce responses per info hash:
150+ - p10: 1
151+ - p25: 1
152+ - p50: 1
153+ - p75: 1
154+ - p90: 2
155+ - p95: 3
156+ - p99: 105
157+ - p99.9: 311
158+ - p100: 395
166159```
167160
168161#### Torrust-Actix UDP Tracker
169162
170- Run the tracker with UDP service enabled on port 3000 and set log level to ` error ` .
163+ Run the tracker with UDP service enabled and other services disabled and set log level to ` error ` .
171164
172165``` toml
166+ log_level = " error"
167+
173168[[udp_trackers ]]
174- bind_address = " 0.0.0.0:3000"
175169enabled = true
176170```
177171
@@ -183,16 +177,32 @@ cargo build --release
183177./target/release/torrust-actix
184178```
185179
186- Running the test: ` aquatic_udp_load_test ` .
180+ Run the load test with:
181+
182+ ``` console
183+ ./target/release/aquatic_udp_load_test
184+ ```
185+
186+ > NOTICE: You need to modify the port in the ` udp_load_test ` crate to use ` 6969 ` and rebuild.
187187
188188``` output
189- Requests out: 3072.94 /second
190- Responses in: 2395.15 /second
191- - Connect responses: 556.79
192- - Announce responses: 1821.16
193- - Scrape responses: 17.20
189+ Requests out: 200953.97 /second
190+ Responses in: 180858.14 /second
191+ - Connect responses: 89517.13
192+ - Announce responses: 89539.67
193+ - Scrape responses: 1801.34
194194 - Error responses: 0.00
195- Peers per announce response: 133.88
195+ Peers per announce response: 1.00
196+ Announce responses per info hash:
197+ - p10: 1
198+ - p25: 1
199+ - p50: 1
200+ - p75: 1
201+ - p90: 2
202+ - p95: 7
203+ - p99: 87
204+ - p99.9: 155
205+ - p100: 188
196206```
197207
198208### Results
@@ -201,9 +211,18 @@ Announce request per second:
201211
202212| Tracker | Announce |
203213| ---------------| -----------|
204- | Aquatic | 379,249 |
205- | Torrust | 11,035 |
206- | Torrust-Actix | 1,821 |
214+ | Aquatic | 192,817 |
215+ | Torrust | 177,508 |
216+ | Torrust-Actix | 89,539 |
217+
218+ Using a PC with:
219+
220+ - RAM: 64GiB
221+ - Processor: AMD Ryzen 9 7950X x 32
222+ - Graphics: AMD Radeon Graphics / Intel Arc A770 Graphics (DG2)
223+ - OS: Ubuntu 23.04
224+ - OS Type: 64-bit
225+ - Kernel Version: Linux 6.2.0-20-generic
207226
208227## Repository benchmarking
209228
0 commit comments