PROPHET/OS

NAME

stress: loads the machine on purpose, one area per thing that can be loaded, so that the tools which measure have something to see

SYNOPSIS

stress [category|area ...] [key=value ...]

DESCRIPTION

Loads the machine on purpose, one area per thing that can be loaded, so that the tools which measure have something to see.

Without an argument it says what can be loaded and does nothing. With one or more area names it starts workers for every one of them, holds the load for duration, and prints what went through and what the machine refused.

The categories and their areas

A category loads everything in it, an area by itself only that one, and all loads every category at once.

| category | area | what it loads | |---|---|---| | cpu | compute | busy on every worker, nothing else | | | vector | a pattern kept in xmm over every switch, so XSAVE carries it | | | services | the unit of work of **every provider of every service** | | memory | memory | take, touch and give back, in pages | | | zero | write nothing over a whole block | | | copy | half a block onto the other half | | | faults | page faults on purpose, one per fresh page | | kernel | threads | a create and exit storm | | | wait | sleep and wake in a pattern, so the timer takes it | | | locks | contention on one lock of this run | | | calls | a storm of system calls | | storage | write | blocks onto a carrier, one file per worker | | | read | the same blocks back off it | | | fs | create, write, rename and delete |

services is the widest of them and it needs no code of its own: every provider carries the standard unit of work of its service since R12-BENCHMARK-01, because benchmark measures with it, and driving that in a loop makes every cipher, every hash, every way to memory and every compressor on this machine work at once.

Several at once is allowed and is the interesting case: stress cpu memory finds what neither alone does.

The knobs

| key | what it says | default | |---|---|---| | duration | how long, in milliseconds | 1000 | | threads | workers per area | one per core | | strength | per cent of the time spent busy | 100 | | ramp | spread the start of the workers over this many ms | 0 | | size | bytes, pages or blocks, depending on the area | per area | | file | the carrier for io and fs | /tmp/stress.dat |

strength is a real duty cycle and not a count of iterations: that many per cent of every ten millisecond slice is spent working and the rest asleep. A count of iterations would mean something different on every machine, and this knob is supposed to say the same thing everywhere.

What a refusal means

The second column of the report counts what the machine said no to: a thread the reaper would not start, memory that came back empty, a call customs refused. **None of those is a failure of the run.** They are the answer the tool was asking for, and the bound holding is the machine working. What this program exists to find is the one case where something gives that should not.

Rule 1 stands over all of it: whatever this does, the kernel does not fall.

Where to look while it runs

| tool | what it shows | |---|---| | top | the whole picture, cores, threads, memory | | locks | the wait tree, and who holds what | | pos_irqhold | how long an interrupt is really kept waiting | | timeout | the deadlines, and which of them were missed | | state | the run state of the machine as the kernel keeps it |

EXAMPLE

$ stress --help
stress [category|area ...] [key=value ...]
  without an argument: the categories and what is in them
  categories: cpu memory kernel storage, and all for every one
  duration=<ms>   how long, 1000 by default
  threads=<n>     workers per area, one per core by default
  strength=<1..100> per cent of the time spent busy
  ramp=<ms>       spread the start of the workers over this
  size=<n>        bytes, pages or blocks, depending on the area