Skip to content

[WIP] Add rperf packageset as a candidate for iperf3 replacement#1103

Open
erewok wants to merge 3 commits intosocallinuxexpo:masterfrom
erewok:cool-rperf-runnings
Open

[WIP] Add rperf packageset as a candidate for iperf3 replacement#1103
erewok wants to merge 3 commits intosocallinuxexpo:masterfrom
erewok:cool-rperf-runnings

Conversation

@erewok
Copy link

@erewok erewok commented Feb 25, 2026

Description of PR

Hello, I have here a working package-set for building rperf as mentioned in #650. One note on repo selection: this repo is a lot more recently maintained than the repo referenced in the issue, so I went with this one instead.

This PR adds the rperf executable.

For context, I asked to @sarcasticadmin about this change and he suggested raising a PR for review. In addition, I am completely new to working in a nix environment, so please feel free to correct anything I'm doing wrong here: I'm clueless and happy to receive instruction.

Previous Behavior

No rperf

New Behavior

You can run an rperf server in nix shell like this:

❯ nix develop
path '/home/erik/workspace/scale-network/nix' does not contain a 'flake.nix', searching up
[nix-flakes nix] $ rperf -s
[2026-02-25T19:48:12Z INFO  rperf::server] server listening on 0.0.0.0:5199

In another shell, we can start a client test run (hitting the server on localhost):

❯ nix develop
path '/home/erik/workspace/scale-network/nix' does not contain a 'flake.nix', searching up

[nix-flakes nix] $ rperf --format json -c 0.0.0.0
[2026-02-25T19:50:06Z INFO  rperf::client] connecting to server at 0.0.0.0:5199...
[2026-02-25T19:50:06Z INFO  rperf::client] connected to server
[2026-02-25T19:50:06Z INFO  rperf::client] preparing for TCP test with 1 streams...
[2026-02-25T19:50:06Z INFO  rperf::client] informing server that testing can begin...
[2026-02-25T19:50:06Z INFO  rperf::client] waiting for server ready signal...
[2026-02-25T19:50:06Z INFO  rperf::client] server ready signal received
[2026-02-25T19:50:06Z INFO  rperf::client] beginning execution of stream 0...
[2026-02-25T19:50:16Z INFO  rperf::client] stream 0 is done
[2026-02-25T19:50:16Z INFO  rperf::client] Client streams done. Waiting for server results...
[2026-02-25T19:50:16Z INFO  rperf::client::state] Starting kill timer (5s) while waiting for server results.
[2026-02-25T19:50:16Z INFO  rperf::client] server reported completion of stream 0
[2026-02-25T19:50:16Z WARN  rperf::client::state] Client run shutdown requested.
{
  "config": {
    "additional": {
      "ip_version": 4,
      "omit_seconds": 0,
      "reverse": false
...

I outputted json format here with the intent of getting this data into Loki where we can build dashboards on top of it, but without a format flag, the output from the client test run looks like this (in entirety):

==========
TCP send result over 10.00s | streams: 1
stream-average bytes per second: 131054.819 | megabits/second: 1.048
total bytes: 1310720 | per second: 131054.819 | megabits/second: 1.048
==========
TCP receive result over 10.00s | streams: 1
stream-average bytes per second: 131053.152 | megabits/second: 1.048
total bytes: 1310720 | per second: 131053.152 | megabits/second: 1.048

I added a README.md to the packaget-set: is this desired or I should remove it? I just wanted to document the above behavior somewhere so it's easy for anyone to use this thing.

Tests

I tested locally but we should be able to dump a rust debug build also and script spinning up a server and hitting it.

@erewok erewok force-pushed the cool-rperf-runnings branch from 06b5820 to fae636b Compare February 25, 2026 20:13
@erewok erewok force-pushed the cool-rperf-runnings branch from fae636b to f5b7952 Compare February 25, 2026 20:40
@kylerisse
Copy link
Member

@erewok the formatting check is a bit aggressive around here, run a nix fmt

@kylerisse
Copy link
Member

@erewok was able to test using your documentation. What I did was locally did a throw away edit to the nixos tests for our routers. Just temporary, we wouldn't want to actually include it this way in real life.

diff --git a/nix/package-sets/scale-nixos-tests/routers.nix b/nix/package-sets/scale-nixos-tests/routers.nix
index 981fec9..02d60f9 100644
--- a/nix/package-sets/scale-nixos-tests/routers.nix
+++ b/nix/package-sets/scale-nixos-tests/routers.nix
@@ -23,6 +23,8 @@
           3 # border <-> expo
         ];

+        environment.systemPackages = [ pkgs.scale-network.rperf ];
+
         scale-network = {
           base.enable = true;
           router.border = {
@@ -35,7 +37,10 @@
         };
       };
     conference =
-      { ... }:
+      {
+        pkgs,
+        ...
+      }:
       {
         _module.args = {
           inherit inputs;
@@ -47,6 +52,9 @@
           2 # border <-> conference
           4 # conference <-> expo
         ];
+
+        environment.systemPackages = [ pkgs.scale-network.rperf ];
+
         scale-network = {
           base.enable = true;
           router.conference = {
@@ -57,7 +65,10 @@
         };
       };
     expo =
-      { ... }:
+      {
+        pkgs,
+        ...
+      }:
       {
         _module.args = {
           inherit inputs;
@@ -69,6 +80,9 @@
           3 # border <-> expo
           4 # conference <-> expo
         ];
+
+        environment.systemPackages = [ pkgs.scale-network.rperf ];
+
         scale-network = {
           base.enable = true;
           router.expo = {
@@ -91,6 +105,8 @@
           10 # NAT
         ];

+        environment.systemPackages = [ pkgs.scale-network.rperf ];
+
         networking.firewall.enable = false;

         networking.useNetworkd = true;

Then ran a nix run .#hydraJobs.scale-nixos-tests.x86_64-linux.routers.driverInteractive which put me in the NixOS testing "shell", a python environment. From there I ran a start_all() which spins up 4 QEMU VMs (1 for each router and a client1). Logged into client1 and border. Set border as the server and ran the client from client1

That procedure produced the attached screenshots. Tool does what it says it does and your docs are accurate.

Screenshot From 2026-02-25 14-54-08 Screenshot From 2026-02-25 14-52-37

Add readme and clean up comments
@erewok erewok force-pushed the cool-rperf-runnings branch from f5b7952 to 46bf638 Compare February 25, 2026 23:46
@erewok
Copy link
Author

erewok commented Feb 25, 2026

@erewok the formatting check is a bit aggressive around here, run a nix fmt

nice! Thanks for the tip.

@erewok
Copy link
Author

erewok commented Feb 25, 2026

@kylerisse thanks for the feedback! Sounds like README.md is fine to keep in the PR? I saw one other package-set with a README.md so I guessed it would be fine to include one here too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants