2
2
3
3
We have two types of benchmarking:
4
4
5
- - E2E benchmarking running the service (HTTP or UDP tracker) .
5
+ - E2E benchmarking running the UDP tracker.
6
6
- Internal torrents repository benchmarking.
7
7
8
8
## E2E benchmarking
9
9
10
10
We are using the scripts provided by [ aquatic] ( https://github.com/greatest-ape/aquatic ) .
11
11
12
- Installing both commands:
12
+ How to install both commands:
13
13
14
14
``` 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 git@github.com:greatest-ape/aquatic.git
23
+ cd aquatic
24
+ cargo build --release -p aquatic_udp_load_test
17
25
```
18
26
19
27
### Run UDP load test
20
28
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 ` .
22
30
23
31
``` toml
24
32
log_level = " error"
25
33
26
34
[[udp_trackers ]]
27
- bind_address = " 0.0.0.0:3000"
28
35
enabled = true
29
36
```
30
37
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
+
31
45
Run the load test with:
32
46
33
47
``` console
34
- aquatic_udp_load_test
48
+ ./target/release/ aquatic_udp_load_test
35
49
```
36
50
51
+ > NOTICE: You need to modify the port in the ` udp_load_test ` crate to use ` 6969 ` and rebuild.
52
+
37
53
Output:
38
54
39
55
``` output
40
56
Starting client with config: Config {
41
- server_address: 127.0.0.1:3000 ,
57
+ server_address: 127.0.0.1:6969 ,
42
58
log_level: Error,
43
59
workers: 1,
44
60
duration: 0,
61
+ summarize_last: 0,
62
+ extra_statistics: true,
45
63
network: NetworkConfig {
46
64
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,
51
67
},
52
68
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,
57
75
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,
62
77
},
63
78
}
64
79
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
70
85
- 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
72
97
```
73
98
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 ` .
91
100
92
101
``` 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
117
119
```
118
120
119
121
### Comparing UDP tracker with other Rust implementations
120
122
121
- #### Torrust UDP Tracker
122
-
123
- Running the tracker:
124
-
125
- ``` console
126
- git@github.com:torrust/torrust-tracker.git
127
- 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
-
144
123
#### Aquatic UDP Tracker
145
124
146
125
Running the tracker:
@@ -149,29 +128,44 @@ Running the tracker:
149
128
git clone git@github.com:greatest-ape/aquatic.git
150
129
cd aquatic
151
130
cargo 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"
153
132
./target/release/aquatic_udp -c "aquatic-udp-config.toml"
154
133
```
155
134
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
+ ```
157
140
158
141
``` 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
164
147
- 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
166
159
```
167
160
168
161
#### Torrust-Actix UDP Tracker
169
162
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 ` .
171
164
172
165
``` toml
166
+ log_level = " error"
167
+
173
168
[[udp_trackers ]]
174
- bind_address = " 0.0.0.0:3000"
175
169
enabled = true
176
170
```
177
171
@@ -183,16 +177,32 @@ cargo build --release
183
177
./target/release/torrust-actix
184
178
```
185
179
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.
187
187
188
188
``` 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
194
194
- 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
196
206
```
197
207
198
208
### Results
@@ -201,9 +211,18 @@ Announce request per second:
201
211
202
212
| Tracker | Announce |
203
213
| ---------------| -----------|
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
207
226
208
227
## Repository benchmarking
209
228
0 commit comments