Skip to content

stress-ng — Workload Profiles ​

Tool: stress-ngCategory: Tool Guide

Workload profiles are YAML files stored in config/profiles/stress-ng/. They define the stressor mix, worker count, and timeout for each test scenario. Start-StressNgTest.ps1 loads the selected profile and translates its settings into stress-ng command-line arguments sent over SSH to each target node.


Available Profiles ​

Profile FileCategoryStressorsWorkersTimeout
cpu-stress.ymlCPUcpu, cpu-cache0 (auto)5 min
memory-stress.ymlMemoryvm, mmap, memrate45 min
io-stress.ymlStorage I/Ohdd, iomix45 min

Profile Details ​

CPU Stress (cpu-stress.yml) ​

yaml
# config/profiles/stress-ng/cpu-stress.yml
name: cpu-stress
description: Saturate all logical CPUs using compute and cache stressors
category: cpu
stressors:
  - cpu
  - cpu-cache
workers: 0          # 0 = one worker per logical CPU (auto-detected by stress-ng)
timeout: 5m
metrics: true

When to use: Validate CPU performance under sustained full load — thermal throttling detection, scheduler latency, NUMA topology verification. A workers: 0 value instructs stress-ng to spawn one worker per logical CPU, fully saturating all cores without manual node-size configuration.

Stressor breakdown:

StressorPurpose
cpuGeneral compute: math, bitwise, string ops
cpu-cacheL1/L2/L3 cache pressure; exercises prefetch and branch prediction

Memory Stress (memory-stress.yml) ​

yaml
# config/profiles/stress-ng/memory-stress.yml
name: memory-stress
description: Exercise virtual memory, anonymous mappings, and memory bandwidth
category: memory
stressors:
  - vm
  - mmap
  - memrate
workers: 4
timeout: 5m
metrics: true

When to use: Validate memory bandwidth and the OS's ability to handle high anonymous page pressure. Useful for confirming NUMA memory affinity configurations and validating ARC/buffer pool behaviour before database workloads. workers: 4 balances load across NUMA nodes on a 4-node ring topology.

Stressor breakdown:

StressorPurpose
vmmmap/munmap allocation loops; triggers page-fault path
mmapLarge anonymous mappings; stress virtual address space
memrateSequential read/write at configurable byte rates; measures memory bandwidth

I/O Stress (io-stress.yml) ​

yaml
# config/profiles/stress-ng/io-stress.yml
name: io-stress
description: Stress disk I/O with mixed sequential and random patterns using hdd and iomix stressors
category: storage
stressors:
  - hdd
  - iomix
workers: 4
timeout: 5m
metrics: true

When to use: Complement fio storage benchmarks with sustained I/O pressure that exercises the OS VFS and scheduler layers. Use this profile before a fio run to confirm the storage stack can sustain load over a multi-minute window without errors.

Stressor breakdown:

StressorPurpose
hddSequential write to temporary files; measures write throughput via VFS
iomixMixed read/write/mmap; mimics application-level mixed workload

Running a Profile ​

powershell
# Single profile on all nodes
.\scripts\Start-StressNgTest.ps1 -RunId "stressng-cpu-$(Get-Date -f yyyyMMddHHmm)" `
    -Profile "cpu-stress"

# Override timeout at runtime (useful for quick smoke tests)
.\scripts\Start-StressNgTest.ps1 -RunId "smoke-$(Get-Date -f yyyyMMddHHmm)" `
    -Profile "cpu-stress" -Timeout "60s"

Profile Sweep Example ​

Run all three profiles in sequence to get a full-system stress picture:

powershell
$runDate = Get-Date -Format "yyyyMMddHHmm"
$profiles = @("cpu-stress", "memory-stress", "io-stress")

foreach ($profile in $profiles) {
    $runId = "stressng-$profile-$runDate"
    Write-Host "Starting profile: $profile (RunId: $runId)"
    .\scripts\Start-StressNgTest.ps1 -RunId $runId -Profile $profile
    .\scripts\Collect-StressNgResults.ps1 -RunId $runId
    Write-Host "Profile $profile complete. Results in logs\stress-ng\$runId\"
}

Profile Schema Reference ​

FieldTypeRequiredDescription
namestringyesProfile identifier; passed to -Profile
descriptionstringnoHuman-readable summary
categorystringyescpu / memory / storage
stressorslist[string]yesstress-ng stressor names (e.g. cpu, vm, hdd)
workersintyesWorker count per stressor; 0 = one per logical CPU
timeoutstringyesDuration string accepted by stress-ng (e.g. 5m, 300s)
metricsboolnoWrite YAML metrics to --metrics-brief; default true

Released under the MIT License.