Skip to content

Commit fae636b

Browse files
committed
Add readme and clean up comments
1 parent 80c434f commit fae636b

File tree

2 files changed

+223
-31
lines changed

2 files changed

+223
-31
lines changed
Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
# rperf
2+
3+
This package-set installs the `rperf` rust application from [Github source](https://github.com/mfreeman451/rperf).
4+
5+
`rperf` is meant to be a drop-in replacement for `iperf3` and should support most of the same arguments. Below are some examples of running a server in one process and a client in another on the same host.
6+
7+
## Starting Server Process on Default Port
8+
9+
In a terminal, we can start the `rperf` server process like this:
10+
11+
```sh
12+
❯ nix develop
13+
path '/home/erik/workspace/scale-network/nix' does not contain a 'flake.nix', searching up
14+
[nix-flakes nix] $ rperf -s
15+
[2026-02-25T19:48:12Z INFO rperf::server] server listening on 0.0.0.0:5199
16+
```
17+
18+
## Starting a Client Test
19+
20+
In another process, we can spawn a client test and output the results as JSON like this:
21+
22+
23+
```sh
24+
❯ nix develop
25+
path '/home/erik/workspace/scale-network/nix' does not contain a 'flake.nix', searching up
26+
27+
[nix-flakes nix] $ rperf --format json -c 0.0.0.0
28+
[2026-02-25T19:50:06Z INFO rperf::client] connecting to server at 0.0.0.0:5199...
29+
[2026-02-25T19:50:06Z INFO rperf::client] connected to server
30+
[2026-02-25T19:50:06Z INFO rperf::client] preparing for TCP test with 1 streams...
31+
[2026-02-25T19:50:06Z INFO rperf::client] informing server that testing can begin...
32+
[2026-02-25T19:50:06Z INFO rperf::client] waiting for server ready signal...
33+
[2026-02-25T19:50:06Z INFO rperf::client] server ready signal received
34+
[2026-02-25T19:50:06Z INFO rperf::client] beginning execution of stream 0...
35+
[2026-02-25T19:50:16Z INFO rperf::client] stream 0 is done
36+
[2026-02-25T19:50:16Z INFO rperf::client] Client streams done. Waiting for server results...
37+
[2026-02-25T19:50:16Z INFO rperf::client::state] Starting kill timer (5s) while waiting for server results.
38+
[2026-02-25T19:50:16Z INFO rperf::client] server reported completion of stream 0
39+
[2026-02-25T19:50:16Z WARN rperf::client::state] Client run shutdown requested.
40+
{
41+
"config": {
42+
"additional": {
43+
"ip_version": 4,
44+
"omit_seconds": 0,
45+
"reverse": false
46+
},
47+
"common": {
48+
"family": "tcp",
49+
"length": 32768,
50+
"streams": 1
51+
},
52+
"download": {},
53+
"upload": {
54+
"bandwidth": 125000,
55+
"duration": 10.0,
56+
"no_delay": false,
57+
"send_interval": 0.05000000074505806
58+
}
59+
},
60+
"streams": [
61+
{
62+
"abandoned": false,
63+
"failed": false,
64+
"intervals": {
65+
"receive": [
66+
{
67+
"bytes_received": 163840,
68+
"duration": 1.0000245571136475,
69+
"timestamp": 1772049007.8585613
70+
},
71+
{
72+
"bytes_received": 163840,
73+
"duration": 1.0501344203948975,
74+
"timestamp": 1772049008.9087107
75+
},
76+
{
77+
"bytes_received": 131072,
78+
"duration": 1.0000648498535156,
79+
"timestamp": 1772049009.9087863
80+
},
81+
{
82+
"bytes_received": 131072,
83+
"duration": 1.0001791715621948,
84+
"timestamp": 1772049010.9089746
85+
},
86+
{
87+
"bytes_received": 131072,
88+
"duration": 1.0003045797348022,
89+
"timestamp": 1772049011.9092996
90+
},
91+
{
92+
"bytes_received": 163840,
93+
"duration": 1.0499694347381592,
94+
"timestamp": 1772049012.959289
95+
},
96+
{
97+
"bytes_received": 131072,
98+
"duration": 1.0002611875534058,
99+
"timestamp": 1772049013.9595702
100+
},
101+
{
102+
"bytes_received": 131072,
103+
"duration": 1.00027334690094,
104+
"timestamp": 1772049014.959864
105+
},
106+
{
107+
"bytes_received": 163840,
108+
"duration": 1.0498690605163574,
109+
"timestamp": 1772049016.009753
110+
}
111+
],
112+
"send": [
113+
{
114+
"bytes_sent": 131072,
115+
"duration": 1.000171422958374,
116+
"sends_blocked": 0,
117+
"timestamp": 1772049007.8583403
118+
},
119+
{
120+
"bytes_sent": 131072,
121+
"duration": 1.0000817775726318,
122+
"sends_blocked": 0,
123+
"timestamp": 1772049008.858432
124+
},
125+
{
126+
"bytes_sent": 131072,
127+
"duration": 1.0000933408737183,
128+
"sends_blocked": 0,
129+
"timestamp": 1772049009.8585322
130+
},
131+
{
132+
"bytes_sent": 131072,
133+
"duration": 1.0001710653305054,
134+
"sends_blocked": 0,
135+
"timestamp": 1772049010.858723
136+
},
137+
{
138+
"bytes_sent": 131072,
139+
"duration": 1.0000975131988525,
140+
"sends_blocked": 0,
141+
"timestamp": 1772049011.858828
142+
},
143+
{
144+
"bytes_sent": 131072,
145+
"duration": 1.0001031160354614,
146+
"sends_blocked": 0,
147+
"timestamp": 1772049012.8589518
148+
},
149+
{
150+
"bytes_sent": 131072,
151+
"duration": 1.0001600980758667,
152+
"sends_blocked": 0,
153+
"timestamp": 1772049013.8591192
154+
},
155+
{
156+
"bytes_sent": 131072,
157+
"duration": 1.000217080116272,
158+
"sends_blocked": 0,
159+
"timestamp": 1772049014.859344
160+
},
161+
{
162+
"bytes_sent": 131072,
163+
"duration": 1.0000717639923096,
164+
"sends_blocked": 0,
165+
"timestamp": 1772049015.8594697
166+
},
167+
{
168+
"bytes_sent": 131072,
169+
"duration": 1.0009231567382812,
170+
"sends_blocked": 0,
171+
"timestamp": 1772049016.8603995
172+
}
173+
],
174+
"summary": {
175+
"bytes_received": 1310720,
176+
"bytes_sent": 1310720,
177+
"duration_receive": 9.15108060836792,
178+
"duration_send": 10.002090334892273
179+
}
180+
}
181+
}
182+
],
183+
"success": true,
184+
"summary": {
185+
"bytes_received": 1310720,
186+
"bytes_sent": 1310720,
187+
"duration_receive": 9.15108060836792,
188+
"duration_send": 10.002090334892273
189+
}
190+
}
191+
```
192+
193+
If no format is specified, output looks like this:
194+
```sh
195+
==========
196+
TCP send result over 10.00s | streams: 1
197+
stream-average bytes per second: 131054.819 | megabits/second: 1.048
198+
total bytes: 1310720 | per second: 131054.819 | megabits/second: 1.048
199+
==========
200+
TCP receive result over 10.00s | streams: 1
201+
stream-average bytes per second: 131053.152 | megabits/second: 1.048
202+
total bytes: 1310720 | per second: 131053.152 | megabits/second: 1.048
203+
```
204+
205+
Back in the **server** process, we can see log messages showing the client connection and a test-run started:
206+
207+
```sh
208+
[2026-02-25T19:49:46Z INFO rperf::server] connection from 127.0.0.1:46136
209+
[2026-02-25T19:49:46Z INFO rperf::server] [127.0.0.1:46136] running in forward-mode: server will be receiving data
210+
[2026-02-25T19:49:46Z INFO rperf::server] [127.0.0.1:46136] preparing for TCP test with 1 streams...
211+
[2026-02-25T19:49:46Z INFO rperf::server] [127.0.0.1:46136] beginning execution of stream 0...
212+
[2026-02-25T19:49:46Z INFO rperf::server] [127.0.0.1:46136] receiver threads spawned, sending ready signal
213+
[2026-02-25T19:49:56Z INFO rperf::server] [127.0.0.1:46136] end of testing signaled
214+
[2026-02-25T19:49:56Z INFO rperf::server] 127.0.0.1:46136 disconnected
215+
[2026-02-25T19:50:06Z INFO rperf::server] connection from 127.0.0.1:45022
216+
[2026-02-25T19:50:06Z INFO rperf::server] [127.0.0.1:45022] running in forward-mode: server will be receiving data
217+
[2026-02-25T19:50:06Z INFO rperf::server] [127.0.0.1:45022] preparing for TCP test with 1 streams...
218+
[2026-02-25T19:50:06Z INFO rperf::server] [127.0.0.1:45022] beginning execution of stream 0...
219+
[2026-02-25T19:50:06Z INFO rperf::server] [127.0.0.1:45022] receiver threads spawned, sending ready signal
220+
[2026-02-25T19:50:16Z INFO rperf::server] [127.0.0.1:45022] end of testing signaled
221+
[2026-02-25T19:50:16Z INFO rperf::server] 127.0.0.1:45022 disconnected
222+
^C[2026-02-25T19:54:39Z WARN rperf::server::state] Server shutdown requested.
223+
```

nix/package-sets/top-level/scale-network/rperf/package.nix

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,3 @@ rustPlatform.buildRustPackage {
2121
homepage = "https://github.com/mfreeman451/rperf";
2222
};
2323
}
24-
25-
26-
# with import <nixpkgs> { };
27-
28-
# rustPlatform.buildRustPackage rec {
29-
# pname = "rperf";
30-
# version = "0.1.23";
31-
# checkType = "debug";
32-
33-
# src = fetchFromGitHub {
34-
# owner = "mfreeman451";
35-
# repo = "rperf";
36-
# rev = "72a02ce0142e7d4da68126ed41522191785824da";
37-
# hash = "sha256-gTdp7LpPwWi6hUu62hMPYbdaLCdQNWPl/VxIrE91vww=";
38-
# };
39-
40-
# nativeBuildInputs = with rustPlatform; [
41-
# rustc
42-
# cargo
43-
# ];
44-
# cargoHash = lib.fakeHash;
45-
# cargoBuildFlags = [
46-
# "--release"
47-
# ];
48-
49-
# meta = {
50-
# description = "A Rust implementation of the iperf3 tool.";
51-
# homepage = "https://github.com/mfreeman451/rperf";
52-
# };
53-
# }
54-

0 commit comments

Comments
 (0)