Skip to content

feat: add CPU benchmarking support with stress-ng - #6

Open
jim-junior wants to merge 2 commits into
urunc-dev:mainfrom
jim-junior:ft-cpu-bench
Open

feat: add CPU benchmarking support with stress-ng#6
jim-junior wants to merge 2 commits into
urunc-dev:mainfrom
jim-junior:ft-cpu-bench

Conversation

@jim-junior

@jim-junior jim-junior commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

This PR adds a CPU performance benchmark adapter using stress-ng.

The adapter measures the bogo operation count and time spent in user and kernel spaces when carrying out those ops. It runs and collects theses metrics from stress-ng.

The PR also includes the docker files used to build the custom stress-ng image. These are in images/stress-ng and for the image used in urunc, its located in images/stress-ng-urunc.

Furthermore, new config values have been introduced in the experiment.yml. These are specific to the cpu experiment and are used to customize the stress-ng behaviour. These include the following:

cpu: 1
cpuMethod: matrixprod
timeout: 30s
metricsBrief: true

They all correspond to valid stress-ng configuration flags with the same names.

How It Works

For each benchmark trial, the adapter:

  1. Pulls the runtime-specific stress-ng image.
  2. Starts an stress-ng container and appends
  3. Within the container, the entrypoint has been updated to a custom script that prints out the metrics results in yaml format to the standard output.
  4. Extracts yaml from the command output and transforms it into JSON
  5. Stores the complete stress-ng result in the benchmark output.
  6. Lastly cleans up the containers created by the harness

Remaining tasks (This section will be removed once these tasks are done)

Building a kernel that can support the stress-ng workload for urunc

- Also added new urunc image for stress-ng

Signed-off-by: jim-junior <jimjunior854@gmail.com>
- enable `CONFIG_SYSFS` in kernel image
- add `urunit` to urunc stress-ng image
- update cpu workload image to `0.7` tag

Signed-off-by: jim-junior <jimjunior854@gmail.com>
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.

1 participant