STRESS-NG(1)

okay bestie, welcome to STRESS-NG(1) from the General Commands Manual โ€” this is the manual page for stress-ng, and we are gonna make it make sense. ๐Ÿ’–

๐Ÿ’– NAME ๐Ÿ’–

stress-ng โ€” stress "next generation", a tool to load and stress a computer system. no cap, that's the whole name. ๐Ÿ’…

๐ŸŒธ SYNOPSIS ๐ŸŒธ

stress-ng [OPTION [ARG]] ...

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

okay so stress-ng stress tests a computer system in various selectable ways. it's designed to exercise physical subsystems of a computer, plus operating system kernel interfaces. it also has a wide range of CPU specific stress tests that exercise floating point, integer, bit manipulation, cache, vector instructions and control flow. highkey a lot of CPU chaos. ๐Ÿ”ฅ

fr fr, stress-ng was originally intended to make a machine work hard and trip hardware issues such as thermal overruns as well as operating system bugs that only occur when a system is being thrashed hard. use stress-ng with caution as some of the tests can make a system run hot on poorly designed hardware and also can cause excessive system thrashing which may be difficult to stop. this is not a drill, bestie. ๐Ÿ˜ญ

stress-ng can also measure test throughput rates; this can be useful to observe performance changes across different operating system releases or types of hardware. however, it has never been intended to be used as a precise benchmark test suite, so do NOT use it in this manner. periodt. ๐Ÿšซ

Running stress-ng with root privileges will adjust out of memory settings on Linux systems to make the stressors unkillable in low memory situations, so use this judiciously. with the appropriate privilege, stress-ng can allow the ionice class and ionice levels to be adjusted โ€” again, this should be used with care. judiciously is doing a lot of work there. ๐Ÿ’€

you can specify the number of processes to invoke per type of stress test; specifying a zero value will select the number of processors available as defined by sysconf(_SC_NPROCESSORS_CONF), and if that can't be determined then the number of online CPUs is used. if the value is less than zero then the number of online CPUs is used. specifying the number as a percentage will select the percentage of configured CPUs (truncated down to nearest whole number). math-ish but make it make sense. ๐Ÿงฎ

โœจ OPTIONS โœจ

General stress-ng control options:

  • --abort โ€” this option will force all running stressors to abort (terminate) if any other stressor terminates prematurely because of a failure. ๐Ÿ’ฅ
  • -A, --aggressive โ€” enables more swap, cache and memory aggressive options as well as forcing CPU affinity changes and maximizing CPU speed. This may slow memory based tests down, consume more power as well as changing the balance of user time verses system time used depending on the type of stressor being used. Specifically, this option enables random madvise for memory mappings/unmappings (potentially causing excess swap activity), force memory mapped pages to be physically resident, change CPU affinity of stressor processes and where possible maximimize CPU P-states and CPU frequencies. โšก
  • -a N, --all N, --parallel N โ€” start N instances of all stressors in parallel. If N is less than zero, then the number of CPUs online is used for the number of instances. If N is zero, then the number of configured CPUs in the system is used. Specifying N as a percentage will select the percentage of configured CPUs (truncated down to nearest whole number). ๐ŸŽ€

๐ŸŒˆ OPTIONS ๐ŸŒˆ

yes bestie, the original really hits us with another OPTIONS heading here. we love a sequel. ๐Ÿ’…

  • --autogroup โ€” with this option any successful nice(2) call will attempt to also set the /proc/self/autogroup setting to the niceness level of the calling process. This is a Linux only option for the CFS scheduler when CONFIG_SCHED_AUTOGROUP is enabled, see sched(7) for more details on how this affects interactive scheduling behaviour. Linux only. ๐Ÿง
  • -b N, --backoff N โ€” wait N microseconds between the start of each stress worker process. This allows one to ramp up the stress tests over time. โณ
  • --buddystat S โ€” every S seconds show buddy allocator free memory sizes and percentage estimation of fragmentation for memory regions zones. Linux only. ๐Ÿง 
  • --buildinfo โ€” report build information such as build date and time, compiler used, compilation and linker flags, standard C version used. ๐Ÿ› ๏ธ
  • --c-states โ€” report CPU C-state residencies. ๐Ÿ’ค
  • --change-cpu โ€” this forces child processes of some stressors to change to a different CPU from the parent on startup. note that during the execution of the stressor the scheduler may choose to move the parent onto the same CPU as the child. the stressors affected by this option are client/server style stressors, such as the network stressors (sock, sockmany, udp, etc) or context switching stressors (switch, pipe, etc). ๐Ÿ”€
  • --class name โ€” specify the class of stressors to run. Stressors are classified into one or more of the following classes: compute, cpu, cpu-cache, device, fp, gpu, hot, interrupt, integer, ipc, io, filesystem, memory, network, os, pipe, scheduler, search, signal, sort, sound, tlb, vector and vm. Some stressors fall into just one class. For example the get stressor is just in the os class. Other stressors fall into more than one class, for example, the lsearch stressor falls into the cpu, cpu-cache, memory and search classes as it exercises all these four. Selecting a specific class will run all the stressors that fall into that class only when run with the --sequential option.

Specifying a name followed by an escaped question mark (for example --class vm\?) will print out all the stressors in that specific class. โ“

  • --compact-memory โ€” compact memory at the start of each stressor invocation to reduce memory fragmentation, requires root capability (Linux only). ๐Ÿงน
  • --config โ€” print out the configuration used to build stress-ng. ๐Ÿ“
  • --drop-caches โ€” drop the page cache, inode and dentry caches before each stressor instance is invoked (Linux only, needs root privilege). ๐Ÿ—‘๏ธ
  • -n, --dry-run โ€” parse options, but do not run stress tests. A no-op. ๐Ÿ™…โ€โ™€๏ธ
  • --dentrystat S โ€” every S seconds show number of allocated directory entries, number of negative directory entries in use and pages requested. Linux only. ๐Ÿ“
  • --exercised โ€” show the features, libraries and system calls exercised by the core of each stressor. ๐Ÿ‘€
  • --exercise-feature list โ€” enable stressors that exercises one or more stressor features specified in the given list, for example: --exercise-features branch,registers to exercise branching and processor registers. Use the --all, --permute or --seq options to specify how to run the stressors. The features available are as follows: ๐Ÿงš
  • \? โ€” shows the per-stressor features โœจ
  • atomic โ€” atomic operations
  • backend-bound-rob โ€” the reorder buffer is full of in-flight instructions, so execution justโ€ฆ stalls ๐Ÿ˜ญ
  • bogo-ops-stable โ€” bogo-ops are reliably stable, so you can actually trust them for benchmarking ๐Ÿ‘‘
  • branch โ€” intensive branch operations
  • branch-miss โ€” CPU branch misses
  • bus-lock โ€” high split lock or locked access operations
  • chaotic-load โ€” generates chaotic system load
  • cipher โ€” cipher computation
  • context-switches โ€” exercises a high context switch rate
  • coverage โ€” generates relatively high kernel function test coverage
  • cpu-shift โ€” CPU left/right shift/rotate operations
  • cpu-bit โ€” CPU logical bit-wise operations (and, or, xor, not)
  • cpu-heavy-ops โ€” execution pipeline saturated with heavy operations
  • cpu-instructions โ€” exercises a higher than normal instruction rate
  • cpu-migrations โ€” generates migrations of stressors between CPUs
  • cpu-opcode โ€” exercises unusual, invalid / privileged instruction opcodes
  • cpu-vector โ€” exercises CPU vector operations
  • crypto โ€” cryptography computation
  • d-cache โ€” data cache operations
  • d-cache-l1-read โ€” data cache level 1 read operations
  • d-cache-l1-write โ€” data cache level 1 write operations
  • d-cache-ll-read โ€” data cache lowest level read operations
  • d-cache-ll-write โ€” data cache lowest level write operations
  • d-cache-miss โ€” data cache miss (read or write)
  • d-cache-prefetch โ€” data cache prefetch (if available)
  • d-cache-read-miss โ€” data cache read miss
  • d-cache-write-miss โ€” data cache write miss
  • d-tlb-read-miss โ€” data cache TLB (translation lookaside buffer) read miss
  • d-tlb-write-miss โ€” data cache TLB (translation lookaside buffer) write miss
  • directory โ€” file system directory operations
  • file-lock โ€” file lock operations
  • frontend-decoder โ€” exercises the CPU instruction frontend decoder
  • filemap-page-cache โ€” kernel filemap page cache hit/miss
  • fp โ€” floating point operations
  • fp-complex โ€” complex floating point operations
  • fp-decimal โ€” decimal floating point operations
  • fp-division โ€” floating point division operations
  • fp-ops โ€” a relatively high floating point operation rate
  • frontend-bound-bandwidth โ€” the front end fetches and decodes instructions at a slower rate than the back end is capable of executing them
  • hash โ€” hash computation
  • heap โ€” exercises memory allocation via the heap
  • hot-package โ€” hot processor package
  • hotplug โ€” hardware hotplugging (e.g. CPUs, memory)
  • i-cache โ€” instruction cache operations
  • i-tlb-read-miss โ€” instruction cache TLB (translation lookaside buffer) read miss
  • integer โ€” integer operations
  • integer-division โ€” integer point division operations
  • integer-ops โ€” a relatively high integer operation rate
  • hash โ€” hash computation (yep, it's in the list twice โ€” keeping it ๐Ÿ’ฏ faithful, not me being chaotic ๐Ÿ™ˆ)
  • heap โ€” exercises memory allocation via the heap
  • hot-package โ€” hot processor package
  • interrupt โ€” high interrupt rate
  • io-async โ€” asynchronous file I/O operations
  • io-read โ€” a relatively high rate of I/O read operations
  • io-therm โ€” I/O operations can noticeably raise I/O device temperature ๐Ÿ”ฅ
  • io-wait โ€” the majority of run time is spent waiting on I/O to complete
  • io-write โ€” a relatively high rate of I/O write operations
  • ioport-read โ€” ioport read operations
  • ioport-write โ€” ioport write operations
  • ipc โ€” inter-process communication primitives
  • kmalloc โ€” kernel physical contiguous memory allocation
  • load-average โ€” high load average (typically at least 4 times more than the number of stressor instances)
  • lock-contention โ€” kernel lock contention
  • maple-tree-read โ€” kernel maple tree read (non-overlapping data range tree)
  • maple-tree-write โ€” kernel maple tree write (non-overlapping data range tree)
  • memory-bus โ€” potentially heavy memory bus exercising
  • memory-bound โ€” memory bandwidth saturation and/or cache misses
  • memory-cmp โ€” memory comparison operations (in searching and sorting)
  • memory-copy โ€” memory copy operations
  • memory-loads โ€” relatively heavy memory load operations
  • memory-stall โ€” pauses in the execution pipe line due to memory waits
  • memory-stores โ€” relatively heavy memory store operations
  • memory-stream โ€” streaming memory read and/or write operations
  • memory-misaligned โ€” memory misaligned reads/writes
  • mmap-lock โ€” kernel memory mapping lock
  • oom โ€” forces out-of-memory failures ๐Ÿ’€
  • page-faults-kernel โ€” kernel space page faults
  • page-faults-major โ€” user space major page faults
  • page-faults-minor โ€” user space minor page faults
  • page-faults-user โ€” user space page faults
  • power-core โ€” processor core high power consumption
  • power-package โ€” processor package high power consumption
  • power-uncore โ€” processor uncore high power consumption
  • registers โ€” CPU registers exercising
  • speculation-mispredict โ€” triggers CPU execution speculation misprediction
  • stack โ€” process stack memory operations
  • string โ€” string operations
  • swap โ€” page swapping (swapfile) exercising
  • syscall-rate โ€” a high rate of system calls per second
  • system-time โ€” around 90% or more execution time in kernel space
  • timer โ€” clocks, alarms and timers exercising
  • tlb โ€” translation lookaside buffer exercising
  • tlb-flush โ€” translation lookaside buffer flushes
  • user-time โ€” around 99% or more execution time in user space
  • v4l2 โ€” video for linux (version 2) exercising
  • virt โ€” virtual machine operations
  • vmalloc โ€” heavy vmalloc kernel memory allocation exercising
  • writeback-dirty-folio โ€” dirty file folio pages written back to storage
  • writeback-dirty-inode โ€” dirty file inodes written back to storage

๐ŸŒˆ --exercise-library list ๐ŸŒˆ

okay so this one enables stressors that exercise one or more libraries, specified in the list you hand it โœจ like, for example: --exercise-library pthread,z for the libpthread and libz libraries. bestie, use the --all, --permute or --seq options to say how you want the stressors run ๐Ÿซถ

The libraries available are as follows:

  • \? โ€” show per stressor libraries used
  • acl โ€” libacl (access control lists)
  • aio โ€” libaio (asynchronous I/O)
  • apparmor โ€” libapparmor (AppArmor)
  • bsd โ€” libbsd (various BSD C library functions)
  • crypt โ€” libcrypt (crypto library)
  • dl โ€” libdl (dynamic object linking)
  • egl โ€” libegl (vendor-neutral dispatch layer for arbitrating OpenGL API calls)
  • gbm โ€” libgbm (generic buffer management API)
  • glesv2 โ€” libglesv2 (OpenGL ES 2.0)
  • gmp โ€” libgmp (GNU multi-precision numbers)
  • IPSec_MB โ€” libIPSec_MB (Intel ยฎ Multi-Buffer Crypto for IPSec)
  • jpeg โ€” libjpeg (JPEG image codec)
  • judy โ€” libjudy (dynamic arrays)
  • lzma โ€” liblzma (lzma compression/decompression)
  • m โ€” libm (math functions)
  • md โ€” libmd (BSD message digest)
  • mpfr โ€” libmpfr (GNU multi-precision floating-point)
  • nl โ€” libnl (Netlink protocol)
  • pthread โ€” libpthread (POSIX threading)
  • rt โ€” librt (POSIX real-time)
  • sctp โ€” libsctp (SCTP socket interface)
  • xxhash โ€” libxxhash (extremely fast hash)
  • z โ€” libz (z compression/decompression)
  • --exercise-syscall list โ€” turns on the stressors that exercise one or more system calls, which you name in the list. Like, --exercise-syscall mmap,fork grabs you the mmap and fork system calls. Drop a \? as the list option and it'll show you which system calls each stressor actually uses ๐Ÿ‘€. And fr, use --all, --permute or --seq to say how you want those stressors run.
  • --ftrace โ€” enables kernel function call tracing (Linux only, bestie). It hooks into the kernel's debugfs ftrace mechanism to record all the kernel functions in use on the system while stress-ng is running. Important vibe check tho: it's only as accurate as the kernel ftrace output itself, so the data reported can vary a little ๐Ÿ˜ญ.
  • -h, --help โ€” show help. That's it, that's the whole thing ๐ŸŽ€.
  • --ignite-cpu โ€” messes with kernel controls to try and max out the CPU ๐Ÿ”ฅ. It needs root privilege because it alters a bunch of /sys interface controls. As of rn it only works on Intel P-State enabled x86 systems on Linux.
  • --interrupts โ€” checks for any system management interrupts or error interrupts that happen, like thermal overruns, machine check exceptions, etc. Little heads up: the interrupts get accounted for by all the concurrently running stressors, so the total count across all stressors is over-accounted ๐Ÿ’€.
  • --ionice-class class โ€” sets the ionice class (Linux only). Options are idle (the default), besteffort, be, realtime, rt.
  • --ionice-level level โ€” sets the ionice level (Linux only). For idle, 0 is literally the only possible option. For besteffort or realtime, it goes 0 (highest priority) to 7 (lowest priority). Peep ionice(1) for the full lore โœจ.
  • --ios โ€” report I/O average read/write rates (Linux only).
  • -I S, --iostat S โ€” every S seconds, show I/O statistics for the device that stores the stress-ng temporary files. That's either the device of the current working directory or the path you gave to --temp-path. Currently a Linux only option ๐Ÿง. The fields it spits out are:
    • Inflight โ€” number of I/O requests that have been issued to the device driver but have not yet completed
    • Rd K/s โ€” read rate in 1024 bytes per second
    • Wr K/s โ€” write rate in 1024 bytes per second
    • Rd/s โ€” reads per second
    • Wr/s โ€” writes per second
  • -j jobfile, --job jobfile โ€” run stressors using a jobfile ๐Ÿ—‚๏ธ. The jobfile is basically a file of stress-ng options (without the leading --), one option per line. Lines can have comments, with the comment text preceded by the # character. A simple example, served fresh:
run sequential   # run stressors sequentially
verbose          # verbose output
metrics-brief    # show metrics at end of run
timeout 60s      # stop each stressor after 60 seconds
#
# vm stressor options:
#
vm 2             # 2 vm stressors
vm-bytes 128M    # 128 MB available memory shared by 2 vm stressors
vm-keep          # keep vm mapping
vm-populate      # populate memory
#
# memcpy stressor options:
#
memcpy 5         # 5 memcpy stressors

The job file brings in the run command, which says how to run the stressors:

  • run sequential - run stressors sequentially
  • run parallel - run stressors together in parallel

Just so you know: run parallel is the default ๐Ÿ‘‘

  • --keep-files โ€” don't remove the files and directories the stressors create. Handy for debugging purposes, but ngl not generally recommended because it can fill up a whole file system ๐Ÿ˜ฌ.
  • -k, --keep-name โ€” by default stress-ng tries to rename the stress processes to match their functionality; this option disables that and keeps the process names as the name of the parent process, which is stress-ng.
  • -K, --klog-check โ€” checks the kernel log for kernel error and warning messages and reports them the second they're detected. Linux only, and it needs root capability to read the kernel log ๐Ÿ”.
  • --ksm โ€” enable kernel samepage merging (Linux only). It's that memory-saving de-duplication feature that merges anonymous (private) pages ๐Ÿ’–.
  • --limit-as โ€” sets the stressor process's maximum size of the virtual memory (address space), see rlimit(2) RLIMIT_AS. The parameter can be an absolute number of bytes (like 1G for 1 GB) or a percentage of the current free memory, like 20%.
  • --limit-data โ€” sets the stressor process's maximum size of the data segment (initialized data, uninitialized data, and heap), see rlimit(2) RLIMIT_DATA. The parameter can be an absolute number of bytes (like 128M for 128 MB) or a percentage of the current free memory, like 5%.
  • --limit-stack โ€” sets the stressor process's maximum size of the stack, see rlimit(2) RLIMIT_STACK. The parameter can be an absolute number of bytes (like 2M for 2 MB) or a percentage of the current free memory, like 1%.
  • --log-brief โ€” by default stress-ng reports the name of the program, the message type and the process id as a prefix on all output. --log-brief outputs messages without those fields, giving you a way less verbose result โœจ.
  • -L filename, --log-file filename โ€” write messages to the specified log file. It doesn't replace the output from stdout, it just makes a logged copy of it in the file you named. Lines of output are automatically fsync'd to the log file to try to reduce data loss ๐Ÿซถ.
  • --log-lockless โ€” log messages normally use a lock so blocks of stressor messages don't intermingle, but that can cause contention when you're emitting a high rate of logging messages in verbose mode with lots of stressors running โ€” for example when testing CPU scaling with many processes on many CPUs. This option disables log message locking ๐Ÿ”“.
  • --make-it-fail โ€” enable fault injection on stressor processes (Linux only, and it needs to run with root permission to write to /proc/self/make-it-fail). The appropriate Linux kernel /sys/kernel/debug fault injection sysfs interfaces need to be set in conjunction when you use this option, and the kernel requires fault injection to be enabled ๐Ÿ’€.
  • --maximize โ€” overrides the default stressor settings and instead sets them to the maximum settings allowed. Those defaults can always be overridden by the per-stressor settings options if you need to ๐Ÿ”ฅ.
  • --max-fd N โ€” sets the maximum limit on file descriptors (a value, or a % of the system allowed maximum). By default stress-ng can use all the available file descriptors; this option sets the limit anywhere from 10 up to the maximum limit of RLIMIT_NOFILE. You can use a % setting too, e.g. 50% is half the maximum allowed file descriptors. Note that stress-ng will use about 5 of the available file descriptors, so take that into consideration when using this setting ๐Ÿ‘€.
  • --mbind list โ€” sets strict NUMA memory allocation based on the list of NUMA nodes you provide; page allocations come from the node with sufficient free memory closest to the specified node(s) where the allocation takes place. This uses the Linux set_mempolicy(2) call with the MPOL_BIND mode. The NUMA nodes to use are given by a comma separated list of nodes (0 to N โˆ’ 1). You can specify a range of NUMA nodes with -, for example: --mbind 0,2-3,6,7-11 ๐ŸŒˆ
  • -M, --metrics โ€” output the number of bogo operations in total performed by the stress processes. Big caveat bestie: these are not a reliable metric of performance or throughput and they were not designed to be used for benchmarking whatsoever ๐Ÿ˜ญ. Some stressors have additional metrics that are more useful than bogo-ops, and those are generally more useful for observing how a system behaves under various kinds of load.

The following columns of information are output:

okay so these are the metric columns youโ€™ll see, and yes bestie, the details matter:

  • bogo ops โ€” number of iterations of the stressor during the run. This is a metric of how much overall โ€œworkโ€ has been achieved in bogo operations. Do not use this as a reliable measure of throughput for benchmarking.
  • real time (secs) โ€” average wall clock duration (in seconds) of the stressor. This is the total wall clock time of all the instances of that particular stressor divided by the number of these stressors being run.
  • usr time (secs) โ€” total user time (in seconds) consumed running all the instances of the stressor.
  • sys time (secs) โ€” total system time (in seconds) consumed running all the instances of the stressor.
  • bogo ops/s (real time) โ€” total bogo operations per second based on wall clock run time. The wall clock time reflects the apparent run time. The more processors one has on a system the more the work load can be distributed onto these and hence the wall clock time will reduce and the bogo ops rate will increase. This is essentially the โ€œapparentโ€ bogo ops rate of the system.
  • bogo ops/s (usr+sys time) โ€” total bogo operations per second based on cumulative user and system time. This is the real bogo ops rate of the system taking into consideration the actual time execution time of the stressor across all the processors. Generally this will decrease as one adds more concurrent stressors due to contention on cache, memory, execution units, buses and I/O devices.
  • CPU used per instance (%) โ€” total percentage of CPU used divided by number of stressor instances. 100% is 1 full CPU. Some stressors run multiple threads so it is possible to have a figure greater than 100%.
  • RSS Max (KB) โ€” resident set size (RSS), the portion of memory (measured in Kilobytes) occupied by a process in main memory.

and now back to the flags, because there are so many more ๐Ÿ‘‘

  • --metrics-brief โ€” show a shorter list of stressor metrics (no CPU used per instance).
  • --minimize โ€” overrides the default stressor settings and instead sets these to the minimum settings allowed. These defaults can always be overridden by the per stressor settings options if required.
  • --no-madvise โ€” from version 0.02.26 stress-ng automatically calls madvise(2) with random madvise advice options before each mmap(2) and munmap(2) call to stress the vm subsystem a little harder. The --no-advise option turns this default off.
  • --no-madvise-opts madvice-list โ€” specify one or more madvise(2) advice options to not use. By default, stress-ng enables all the available madvise advice options for randomly selecting one before each mmap(2) and munmap(2) call., this option allow one or more of these to be disabled. Available advice options (depending on system) are as follows: cold, dodump, dofork, dontdump, dontfork, dontneed, free, hugepage, mergeable, nohugepage, normal, pageout, populate-read, populate-write, random, sequential, unmergeable and willneed.
  • --no-oom-adjust โ€” disable any form of out-of-memory score adjustments, keep the system defaults. Normally stress-ng will adjust the out-of-memory scores on stressors to try to create more memory pressure. This option disables the adjustments.
  • --no-rand-seed โ€” Do not seed the stress-ng pseudo-random number generator with a quasi random start seed, but instead seed it with constant values. This forces tests to run each time using the same start conditions which can be useful when one requires reproducible stress tests.
  • --oom-avoid โ€” Attempt to avoid out-of-memory conditions that can lead to the Out-of-Memory (OOM) killer terminating stressors. This checks for low memory scenarios and swapping before making memory allocations and hence adds some overhead to the stressors and will slow down stressor allocation speeds.
  • --oom-avoid-bytes N โ€” Specify a low memory threshold to avoid making any further memory allocations. The parameter can be specified as an absolute number of bytes (e.g. 2M for 2 MB) or a percentage of the current free memory, e.g. 5% (the default is 2.5%). This option implicitly enables --oom-avoid. The option allows the system to have enough free memory to try to avoid the out-of-memory killer terminating processes.
  • --oom-no-child โ€” Disable running stressor as a child process with a parent that checks for Out-of-Memory (OOM) issues. This reduces additional child process overhead but indirectly also disables respawning of OOM'd stressors, OOM detection and may lead to bogo-op verification errors.
  • -O, --oomable โ€” Do not respawn a stressor if it gets killed by the Out-of-Memory (OOM) killer. The default behaviour is to restart a new instance of a stressor if the kernel OOM killer terminates the process. This option disables this default behaviour.
  • --page-in โ€” touch allocated pages that are not in core, forcing them to be paged back in. This is a useful option to force all the allocated pages to be paged in when using the bigheap, mmap and vm stressors. It will severely degrade performance when the memory in the system is less than the allocated buffer sizes. This uses mincore(2) to determine the pages that are not in core and hence need touching to page them back in.
  • --pathological โ€” enable stressors that are known to hang systems. Some stressors can rapidly consume resources that may hang a system, or perform actions that can lock a system up or cause it to reboot. These stressors are not enabled by default, this option enables them, but you probably don't want to do this. You have been warned. This option applies to the stressors: bad-ioctl, bind-mount, cpu-online, mlockmany, oom-pipe, smi, sysinval and watchdog.
  • --pause T โ€” pause T seconds between each stressor. This is useful for allowing systems to cool down between each stressor invocation. By default this option is disabled.
  • --perf โ€” measure processor and system activity using perf events. Linux only and caveat emptor, according to perf_event_open(2): โ€œAlways double-check your results! Various generalized events have had wrong valuesโ€. Note that with Linux 4.7 one needs to have CAP_SYS_ADMIN capabilities for this option to work, or adjust /proc/sys/kernel/perf_event_paranoid to below 2 to use this without CAP_SYS_ADMIN.
  • --permute N โ€” run all permutations of the selected stressors with N instances of the permutated stressors per run. If N is less than zero, then the number of CPUs online is used for the number of instances. If N is zero, then the number of configured CPUs in the system is used. Specifying N as a percentage will select the percentage of configured CPUs (truncated down to nearest whole number). This will perform multiple runs with all the permutations of the stressors up to 2โ†‘20 permutations. Use this in conjunction with the --with or --class option to specify the stressors to permute.
  • --progress โ€” display the run progress when running stressors with the --sequential option.
  • -q, --quiet โ€” do not show any output.
  • -r N, --random N โ€” start N random stress workers. If N is 0, then the number of configured processors is used for N.
  • --randprocname โ€” enable random stressor process name generation. This scrambles the stressor process names to try to confuse process monitoring and potential smart process scheduling that uses process names to make system tuning changes.
  • --rapl โ€” Report the Running Average Power Limit (RAPL) energy measurements of stressor instances. Currently Linux and x86 only, requires root access rights to read RAPL kernel interfaces. Note that the RAPL domains supported may vary between devices.
  • --raplstat S โ€” every S seconds show RAPL energy measurements. Currently Linux and x86 only, requires root access rights to read RAPL kernel interfaces.
  • --resctrl p1[,p2,..,pn],s1[,s2..,sm] โ€” specify resource control cache partitions and apply to stressor instances (ARM MPAM only)

p1..pn are a list of 1 to n cache partitioning definitions, where p1..pn are of the form:

pN=node[:cachelevel]:hexbitmask:bandwidth

where:

  • pN is the partition definition name where N is a number, e.g. p1
  • node specifies cluster node of CPUs to use
  • cachelevel specifies the cache level to use (optional, the default is the MPAM default L3 level)
  • hexbitmask is a hexadecimal bitmask specifying cache portions to use
  • bandwidth is the bandwidth to use, for MPAM this is % utilization 1..100

for example:

p1=1:L3:fff:50

s1..sm are a list of 1 to m of stressor instances that apply these cache partitioning settings of the form:

stressor-name=stressor-instances@pN

where:

  • stressor-name is literally just the name of a stressor ๐Ÿ’…
  • stressor-instances is a list of instances where the cache partitioning setting pN gets applied
  • pN specifies the cache partition pN

okay so the following example applies resctrl partition p1 to the matrix stressor on instances 0, 1, 5, 8, 12, 13 and 14 โ€” iconic range syntax, no notes:

matrix=0-1,5,8,12-14@p1

and this next example is the main character fr โ€” it specifies two resctrl partitions. p1 uses cluster node 1, L3 cache, uses the first 3 cache portions and sets this to 10% utilisation. p2 uses cluster 1, the default L3 cache, all cache portions except the first 32 and sets this to 90% utilisation. The 3 stream stressor instances are run where stream stressor instances 0 to 1 use p1, and instance 2 uses p2. look at her go ๐Ÿซถ

sudo stress-ng --resctrl p1=1:l3:7:10,p2=1:ff8:90,\
stream=0-1@p1,stream=2@p2 --stream 3
โš ๏ธ heads up bestie: invalid resctrl parameters applied to the resctrl sysfs will generate EINVAL errors. They are not sanity checked during option parsing because these can only be determined at the time they are applied. so like, don't come for the parser, she literally can't know yet ๐Ÿ’€
  • --sched scheduler โ€” select the named scheduler (only on Linux). Wanna see the list of available schedulers? just run: stress-ng --sched which โœจ
  • --sched-prio prio โ€” select the scheduler priority level (only on Linux). If the scheduler doesn't support this then the default priority level of 0 is chosen. no drama ๐ŸŒธ
  • --sched-period period โ€” select the period parameter for the deadline scheduler (only on Linux). The default value is 0 (in nanoseconds).
  • --sched-runtime runtime โ€” select the runtime parameter for the deadline scheduler (only on Linux). The default value is 99999 (in nanoseconds).
  • --sched-deadline deadline โ€” select the deadline parameter for the deadline scheduler (only on Linux). The default value is 100000 (in nanoseconds).
  • --sched-reclaim โ€” use the CPU bandwidth reclaim feature for the deadline scheduler (only on Linux). slay ๐Ÿฆ‹
  • --seed N โ€” set the random number to generate a seed with a 64 bit value. This lets stressors use the same random number generator sequences on each invocation. reproducibility is the vibe ๐Ÿ‘‘
  • --settings โ€” show the various option settings. it's giving receipts ๐Ÿ’…
  • --sequential N โ€” sequentially run all the stressors one by one for a default of 60 seconds. The number of instances of each of the individual stressors to be started is N. If N is less than zero, then the number of CPUs online is used for the number of instances. If N is zero, then the number of CPUs in the system is used. Specifying N as a percentage will select the percentage of configured CPUs (truncated down to nearest whole number). one by one, single file, no cuts ๐ŸŽ€

โœจ OPTIONS โœจ (the sequel, because there are So Many)

Use the --timeout option to specify the duration to run each stressor. yes, we know, we're getting to it.

  • --skip-silent โ€” silence the messages that report a stressor has been skipped because it requires features not supported by the system, such as unimplemented system calls, missing resources or processor specific features. sometimes you simply do not want to hear it ๐Ÿ™ˆ
  • --smart โ€” scan the block devices for changes in S.M.A.R.T. statistics (Linux only). This requires root privileges to read the Self-Monitoring, Analysis and Reporting Technology data from all block devices and will report any changes in the statistics. One caveat: device manufacturers provide different sets of data, the exact meaning of the data can be vague and the data may be inaccurate. so like, girl data is data, take it with a grain of salt ๐Ÿ˜ญ
  • --sn โ€” use scientific notation (e.g. 2.412e+01) for metrics. nerd mode activated, and honestly? ate ๐Ÿ”ฅ
  • --status N โ€” report every N seconds the number of running, exiting, reaped and failed stressors, the number of stressors that received the SIGARLM termination signal as well as the current run duration. yes, SIGARLM, that's how it's written in the man page, we don't make the rules ๐Ÿ’€
  • --stderr โ€” write messages to stderr. With version 0.15.08 output is written to stdout; previously, due to a historical oversight, output went to stderr. This option lets you revert to the pre-0.15.08 behaviour. nostalgia for the old days ๐ŸŽ€
  • --stdout โ€” all output goes to stdout. This is the new default for version 0.15.08. Use the --stderr option for the original behaviour. she moved on, bestie โœจ
  • --stressor-time โ€” (requires the -v flag) log as debug the start and finish run times of each stressor instance, logged in the format: stressor [start|finish] HR:MN:SS.HS YYYY:MM:DD where HR is hours, MN is minutes, SS is seconds, HS is hundredths of seconds, YYYY is years, MM is months, DD is day of the month. If localtime(2) is not supported the time is logged as seconds past the Epoch. timestamps everywhere, we love a paper trail ๐Ÿฆ‹
  • --stressors โ€” output the names of the available stressors. just the names, all of them, a whole cast list ๐Ÿ‘‘
  • --sync-start โ€” synchronize start: wait for stressors to be created and start all stressors once they are all in a ready to run state. everyone hits their mark at the same time, theatre kid energy ๐ŸŽญ
  • --syslog โ€” log output (except for verbose -v messages) to the syslog. so the sysadmin can find it later ๐Ÿ’…
  • --taskset list โ€” set CPU affinity based on the list of CPUs provided; stress-ng is bound to just use these CPUs (for systems that provide sched_setaffinity(2)). The CPUs to be used are specified by a comma separated list of CPU (0 to N โˆ’ 1). You can specify a range of CPUs using -, for example: --taskset 0,2-3,6,7-11 or the following keywords:
    • even โ€” even numbered CPUs
    • odd โ€” odd numbered CPUs
    • all โ€” all CPUs
    • random โ€” random selection of CPUs
    • packageN โ€” CPUs in package N as specified by /sys/devices/system/cpu/cpu*/topology/package_cpus_list
    • clusterN โ€” CPUs in package N as specified by /sys/devices/system/cpu/cpu*/topology/cluster_cpus_list
    • dieN โ€” CPUs in package N as specified by /sys/devices/system/cpu/cpu*/topology/die_cpus_list
    • coreN โ€” CPUs in package N as specified by /sys/devices/system/cpu/cpu*/topology/core_cpus_list
  • --taskset-random โ€” randomly change stressor CPU affinity at five times the clock tick rate (if defined) or at 400Hz while waiting for stressors to complete. chaos, but make it scheduled ๐ŸŒˆ
  • --temp-path path โ€” specify a path for stress-ng temporary directories and temporary files; the default path is the current working directory. This path must have read and write access for the stress-ng stress processes. no access, no temp files, no mercy ๐Ÿซถ
  • --thermalstat S โ€” every S seconds show CPU and thermal load statistics. This option shows average CPU frequency in GHz (average of online-CPUs), the minimum CPU frequency, the maximum CPU frequency, load averages (1 minute, 5 minute and 15 minutes) and available thermal zone temperatures in degrees Centigrade. is it hot in here or is it just the thermal zones ๐Ÿ”ฅ
  • --thrash โ€” This can only be used when running on Linux and with root privilege. This option starts a background thrasher process that works through all the processes on a system and tries to page-in as many pages in the processes as possible. It also periodically drops the page cache, frees reclaimable slab objects and pagecache as well as assigning pages to different NUMA nodes. This will cause a considerable amount of thrashing of swap on an over-committed system.
๐Ÿ’€ ok this one is genuinely unhinged and that's the point โ€” considerable thrashing of swap on an over-committed system is the goal, not a bug. root + Linux only. respect the chaos.
  • -t N, --timeout T โ€” run each stress test for at least T seconds. One can also specify the units of time in seconds, minutes, hours, days or years with the suffix s, m, h, d or y. Each stressor will be sent a SIGALRM signal at the timeout time, however if the stress test is swapped out, in an uninterruptible system call or performing clean up (such as removing hundreds of test files) it may take a while to finally terminate. A 0 timeout will run stress-ng forever with no timeout. The default timeout is 24 hours. yes, twenty-four hours by default, she's committed ๐Ÿ˜ญ
  • --timer-slack N โ€” adjust the per process timer slack to N nanoseconds (Linux only). Increasing the timer slack allows the kernel to coalesce timer events by adding some fuzziness to timer expiration times and hence reduce wakeups. Conversely, decreasing the timer slack will increase wakeups. A value of 0 for the timer-slack will set the system default of 50000 nanoseconds. fuzziness, but like, on purpose โœจ
  • --times โ€” show the cumulative user and system times of all the child processes at the end of the stress run. The percentage of utilisation of available CPU time is also calculated from the number of on-line CPUs in the system. receipts on receipts ๐Ÿ“Š
  • --timestamp โ€” add a timestamp in hours, minutes, seconds and hundredths of a second to the log output. so you know exactly when it went down ๐Ÿ’…
  • --tz โ€” collect temperatures from the available thermal zones on the machine (Linux only). Some devices may have one or more thermal zones, whereas others may have none. lowkey a lottery ๐ŸŽฒ
  • -v, --verbose โ€” show all debug, warnings and normal information output. she tells you everything ๐Ÿ—ฃ๏ธ
  • --verify โ€” verify results when a test is run. This is not available on all tests. This will sanity check the computations or memory contents from a test run and report with the fail tag failures that are detected. trust but verify, bestie ๐Ÿงš
  • --verifiable โ€” print the names of stressors that can be verified with the --verify option. the verified girlies only ๐Ÿ‘‘
  • -V, --version โ€” show version of stress-ng, version of toolchain used to build stress-ng and system information. the full origin story ๐ŸŒธ
  • --vmstat S โ€” every S seconds show statistics about processes, memory, paging, block I/O, interrupts, context switches, disks and CPU activity. The output is similar to the output from the vmstat(8) utility. Not fully supported on various UNIX systems. retro icon behaviour ๐Ÿ’œ
  • --vmstat-units [ k | m | g | t | p | e ] โ€” specify vmstat memory units in terms of kilobytes (k), megabytes (m), gigabytes (g), terabytes (t), petabytes (p) or exabytes (e). The default is in kilobytes. pick your unit, pick your fighter ๐Ÿฆ‹
  • -w, --with list โ€” specify stressors to run when using the --all, --seq or --permute options. For example, to run 5 instances of the cpu, hash, nop and vm stressors one after another (sequentially) for 1 minute per stressor use:
stress-ng --seq 5 --with cpu,hash,nop,vm --timeout 1m
  • -x, --exclude list โ€” specify a list of one or more stressors to exclude (that is, do not run them). This is useful to exclude specific stressors when one selects many stressors to run using the --class option, --sequential, --all and --random options. Example, run the CPU class stressors concurrently and exclude the numa and search stressors:
stress-ng --class cpu --all 1 -x numa,bsearch,hsearch,lsearch
  • -Y, --yaml filename โ€” drops all the stats it gathered into a YAML-formatted file called filename. Structured data, bestie ๐Ÿ’…

๐ŸŒธ Stressor specific options ๐ŸŒธ

Okay so this is where it gets fun โ€” every stressor gets its own little corner of options. Buckle up ๐ŸŽ€

๐ŸŽ€ Access stressor

  • --access N โ€” spins up N workers that cycle through all the file mode bit combos (read, write, execute) for the file owner, then checks whether the user permissions of the file are actually sane using access(2) and faccessat(2). Permission vibes check โœจ
  • --access-ops N โ€” tells the access workers to stop after N bogo access sanity checks.

๐ŸŽ€ Process accounting stressor

  • --acct N โ€” starts N workers that go exercise the acct(2) accounting interface. It opens an accounting file, creates a child process, exits it, and then reads back the accounting data and sanity-checks it. That accounting file is capped at 16MB max. Linux only, and it needs CAP_SYS_PACCT capabilities, no cap ๐Ÿงข
  • --acct-ops N โ€” stop after N bogo accounting records have been read.

๐ŸŽ€ POSIX Access Control List stressor

  • --acl N โ€” starts N workers that exercise permutations of ACL access permission settings across the user, group and other tags.
  • --acl-rand โ€” randomizes the order of the ACL access permissions (by shuffling them) before it goes exercising ACLs. Chaos mode, but make it permissions ๐Ÿ™ˆ
  • --acl-ops N โ€” stops acl workers once N bogo acl settings have been set.

๐ŸŽ€ Affinity stressor

  • --affinity N โ€” starts N workers, and each one runs 16 processes that rapidly flip CPU affinity (on systems that actually provide sched_setaffinity(2)). Heads up: rapidly switching CPU affinity can lowkey contribute to poor cache behaviour and a high context switch rate. It's giving chaos ๐ŸŒ€
  • --affinity-delay N โ€” delays for N nanoseconds before changing affinity to the next CPU. The delay spins on CPU scheduling yield operations for those N nanoseconds before the process gets moved to another CPU. The default is 0 nanosconds.
  • --affinity-ops N โ€” stop affinity workers after N bogo affinity operations.
  • --affinity-pin โ€” pins all 16 per-stressor processes to a CPU. All 16 processes follow whichever CPU the main parent stressor picked, which forces heavy per-CPU loading. Main character CPU energy ๐Ÿ‘‘
  • --affinity-procs N โ€” sets how many processes per affinity instance to run. The range is 2 to 1024, default is 16.
  • --affinity-rand โ€” switches CPU affinity randomly instead of the default sequential behaviour.
  • --affinity-sleep N โ€” sleeps for N nanoseconds before changing affinity to the next CPU.

๐ŸŽ€ Kernel crypto AF_ALG API stressor

  • --af-alg N โ€” starts N workers that exercise the AF_ALG socket domain by hashing and encrypting random messages of various sizes. This hits up all the available hashes, ciphers, rng and aead crypto engines in the Linux kernel. Crypto girlies rise ๐Ÿ”ฅ
  • --af-alg-dump โ€” dumps that internal list representing the cryptographic algorithms (parsed from the /proc/crypto file) straight to standard output (stdout).
  • --af-alg-ops N โ€” stops af-alg workers after N AF_ALG messages have been hashed.
  • --af-alg-type [ all | ahash | shash | skcipher | rng | aead ] โ€” picks the crypto type. all is the default, and yes it means literally all the types.

๐ŸŽ€ Asynchronous I/O stressor (POSIX AIO)

  • --aio N โ€” starts N workers that fire off multiple small asynchronous I/O writes and reads on a relatively small temporary file, using the POSIX aio interface. Fr fr this just hits the file system cache and soaks up a lot of user and kernel time issuing and handling those I/O requests. By default each worker process handles 16 concurrent I/O requests.
  • --aio-ops N โ€” stop POSIX asynchronous I/O workers after N bogo asynchronous I/O requests.
  • --aio-requests N โ€” sets how many POSIX asynchronous I/O requests each worker should issue. Default is 16, and 1 to 4096 are allowed.

๐ŸŽ€ Asynchronous I/O stressor (Linux AIO)

  • --aiol N โ€” starts N workers that issue multiple 4 K random asynchronous I/O writes using the Linux aio system calls io_setup(2), io_submit(2), io_getevents(2) and io_destroy(2). By default each worker process handles 16 concurrent I/O requests.
  • --aiol-ops N โ€” stop Linux asynchronous I/O workers after N bogo asynchronous I/O requests.
  • --aiol-requests N โ€” sets how many Linux asynchronous I/O requests each worker should issue. Default is 16, and 1 to 4096 are allowed.

๐ŸŽ€ Alarm stressor

  • --alarm N โ€” starts N workers that exercise alarm(2) with MAXINT, 0 and random alarm and sleep delays that get prematurely interrupted. Before each alarm is scheduled, any previous pending alarms get cancelled with zero-second alarm calls. So rude, but so effective โฐ
  • --alarm-ops N โ€” stop after N alarm bogo operations.

๐ŸŽ€ AppArmor stressor

  • --apparmor N โ€” starts N workers that exercise various parts of the AppArmor interface. Currently you need root permission to run this particular test. Only available on Linux systems with AppArmor support, and it requires the CAP_MAC_ADMIN capability. Root girlies only ๐Ÿ’…
  • --apparmor-ops โ€” stops the AppArmor workers after N bogo operations.

๐ŸŽ€ Atomic stressor

  • --atomic N โ€” starts N workers that exercise various GCC __atomic_*() built-in operations on 8, 16, 32 and 64 bit integers that are shared among the N workers. Heads up: this stressor is only available for builds using GCC 4.7.4 or higher. It forces many front end cache stalls and cache references. Also note that 32 bit systems do not currently exercise 64 bit integers โ€” sad but true ๐Ÿ˜ญ
  • --atomic-ops N โ€” stops the atomic workers after N bogo atomic operations.

๐ŸŽ€ Bad alternative stack stressor

  • --bad-altstack N โ€” starts N workers that create broken alternative signal stacks for SIGSEGV and SIGBUS handling, which in turn create secondary SIGSEGV/SIGBUS errors. A whole variety of randomly selected nefarious methods get used to create those stacks ๐Ÿ‘€:
    • Unmapping the alternative signal stack, before triggering the signal handling.
    • Changing the alternative signal stack to just being read only, write only, execute only.
    • Using a NULL alternative signal stack.
    • Using the signal handler object as the alternative signal stack.
    • Unmapping the alternative signal stack during execution of the signal handler.
    • Using a read-only text segment for the alternative signal stack.
    • Using an undersized alternative signal stack.
    • Using the VDSO as an alternative signal stack.
    • Using an alternative stack mapped onto /dev/zero.
    • Using an alternative stack mapped to a zero sized temporary file to generate a SIGBUS error.
  • --bad-altstack-ops N โ€” stops the bad alternative stack stressors after N SIGSEGV bogo operations.

๐ŸŽ€ Bad ioctl stressor

  • --bad-ioctl N โ€” starts N workers that perform a whole range of illegal bad read ioctl(2) calls (using _IOR) and write ioctls (using _IOR with PROT_NONE mapped pages) across the device drivers. This exercises page size, 64 bit, 32 bit, 16 bit and 8 bit reads, plus NULL addresses, non-readable pages and PROT_NONE mapped pages. Currently Linux only, and it requires the --pathological option ๐Ÿซ 
  • --bad-ioctl-alldev โ€” exercises ioctl calls on all devices. The default is just to exercise the first occurrence of a device (e.g. /dev/i2c-0), but this option exercises all devices (e.g. /dev/i2c-*) and therefore takes far more time to work through all of them. Respect the commitment ๐Ÿซถ
  • --bad-ioctl-method [ inc | random | random-inc | stride ] โ€” picks the method for changing the ioctl command (number, type) tuple per iteration. Default is random-inc. The available bad-ioctl methods are described as follows:
    • inc โ€” increment ioctl command by 1
    • random โ€” use a random ioctl command
    • random-inc โ€” increment ioctl command by a random value
    • random-stride โ€” increment ioctl command number by 1 and decrement command type by 3
  • --bad-ioctl-ops N โ€” stops the bad ioctl stressors after N bogo ioctl operations.

๐ŸŽ€ Bessel functions

  • --besselmath N โ€” starts N workers that exercise various Bessel functions. Results get sanity checked to make sure no variation occurs after each round of 10000 computations. Math girlie behaviour, honestly iconic ๐Ÿงฎ
  • --besselmath-ops N โ€” stop after N bessel bogo-operation loops.
  • --besselmath-method method โ€” specifies which Bessel function to exercise. The available bessel stress methods are described as follows:
  • all โ€” iterate over all the below Bessel functions methods
  • j0 โ€” double precision Bessel function of the first kind of order 0
  • j1 โ€” double precision Bessel function of the first kind of order 1
  • jn โ€” double precision Bessel function of the first kind of order n (where n = 5 for this test)
  • j0f โ€” float precision Bessel function of the first kind of order 0
  • j1f โ€” float precision Bessel function of the first kind of order 1
  • jnf โ€” float precision Bessel function of the first kind of order n (where n = 5 for this test)
  • j0l โ€” long double precision Bessel function of the first kind of order 0
  • j1l โ€” long double precision Bessel function of the first kind of order 1
  • jnl โ€” long double precision Bessel function of the first kind of order n (where n = 5 for this test)
  • y0 โ€” double precision Bessel function of the second kind of order 0
  • y1 โ€” double precision Bessel function of the second kind of order 1
  • yn โ€” double precision Bessel function of the second kind of order n (where n = 5 for this test)
  • y0f โ€” float precision Bessel function of the second kind of order 0
  • y1f โ€” float precision Bessel function of the second kind of order 1
  • ynf โ€” float precision Bessel function of the second kind of order n (where n = 5 for this test)
  • y0l โ€” long double precision Bessel function of the second kind of order 0
  • y1l โ€” long double precision Bessel function of the second kind of order 1
  • ynl โ€” long double precision Bessel function of the second kind of order n (where n = 5 for this test)

๐Ÿ”ฅ Big heap stressor ๐Ÿ”ฅ

  • -B N, --bigheap N โ€” spin up N workers that grow their heaps by reallocating memory. If the out of memory killer (OOM) on Linux kills the worker, or the allocation just straight-up fails, then the allocating process starts all over again from scratch. Also bestie, heads up: the OOM adjustment for the worker is set so that the OOM killer will treat these workers as the first candidate processes to kill. They are literally volunteering to get yeeted ๐Ÿ’€
  • --bigheap-bytes N โ€” max heap growth, as N bytes per bigheap worker. You can give the size as a % of total available memory, or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g. Slay, flexible units ๐ŸŽ€
  • --bigheap-growth N โ€” how much memory to grow the heap by per iteration. Size can be from 4 K to 64 MB. Default is 64 K.
  • --bigheap-mlock โ€” attempt to mlock(2) future allocated pages into memory, which causes more memory pressure (iconic chaos honestly). If mlock(MCL_FUTURE) is implemented then this will stop newly allocated pages from being swapped out. ๐Ÿซถ
  • --bigheap-ops N โ€” stop the big heap workers after N bogo allocation operations are completed.

๐ŸŽ€ Binderfs stressor ๐ŸŽ€

  • --binderfs N โ€” start N workers that mount, exercise and unmount binderfs. The binder control device gets exercised with 256 sequential BINDER_CTL_ADD ioctl(2) calls per loop. busy busy busy โœจ
  • --binderfs-ops N โ€” stop after N binderfs cycles.

๐Ÿ’… Bind mount stressor ๐Ÿ’…

  • --bind-mount N โ€” start N workers that repeatedly bind mount /bin to a temporary path. This can consume resources rapidly.
โš ๏ธ Do not use this stressor unless you want to risk hanging your machine. Like, for real for real. Ngl this one is giving "chaos gremlin" energy ๐Ÿ˜ญ Requires the CAP_SYS_ADMIN capability.
  • --bind-mount-ops N โ€” stop after N bind mount bogo operations.

๐Ÿฆ‹ Bitonic sort stressor ๐Ÿฆ‹

  • --bitonicsort N โ€” start N workers that sort 32 bit integers using bitonic sort. so satisfying to watch, lowkey โœจ
  • --bitonicsort-ops N โ€” stop bitonic sort stress workers after N bogo bitonic sorts.
  • --bitonicsort-size N โ€” how many 32 bit integers to sort, default is 262144 (256 ร— 1024).

๐Ÿ‘‘ Bit manipulation operations ๐Ÿ‘‘

  • --bitops N โ€” start N workers that perform various calculations using 32 bit integer manipulation operations. Many of these are derived from the Stanford "Bit Twiddling Hacks" (Sean Eron Anderson) and Hacker's Delight (Henry S. Warren, Jr.) โ€” the iconic bit-twiddling canon, periodt ๐Ÿ“š
  • --bitops-ops N โ€” stop after N bitop operations.
  • --bitops-method method โ€” pick the bitops stress method. By default, all the bitops stress methods are exercised sequentially, but you can specify just one method to be used if required. The available bitops stress methods are, and I quote the vibes:
    • all โ€” iterate over all the below bitops stress methods.
    • abs โ€” calculate the absolute value of a 32 bit signed integer. Computed two different ways, one with masking and addition, one with masking and subtraction.
    • bswap โ€” swap bytes in a 32 bit unsigned integer. Computed 3 ways, two with byte shifting and one using a builtin intrinsic. Some optimisers may convert these into a single bswap operation.
    • countbits โ€” count the number of bits set to 1 in a 32 bit unsigned integer. Computed six different ways, two with bit counting, one with 64 bit multiplication, one with parallelised masking and shifting, one using triple masking and shifts, one using a builtin popcount function.
    • clz โ€” count the number of leading zero bits in a 32 bit unsigned integer. Computed four different ways, one with bit counting, one with log2 shifting, one using a builtin popcount function, one using a builtin clz function,
    • ctz โ€” count the number of trailing zero bits in a 32 bit unsigned integer. Computed five different ways, one with bit counting, one using masking and shifting, one using the masking and ternary operator Gaudet method, one using a builtin clz function, one using a builtin popcount function.
    • cmp โ€” compare two 32 bit unsigned integers with comparison results of โˆ’1, 0, 1 for less than, equal or greater than. Computed 3 ways, one using simple comparisons, two using comparisons and subtraction.
    • log2 โ€” calculate log base 2 of a 32 bit unsigned integer. Computed four ways, one using bit counting, one using masking and shifting and branching, one using masking and shifting with no branching, one using shifting and bitwise or'ing.
    • max โ€” find the maximum of two 32 bit unsigned integers without a temporary variable. Computed two ways, one using xor'ing and masking, one using the ternary operator.
    • min โ€” find the minimum of two 32 bit unsigned integers without a temporary variable. Computed two ways, one using xor'ing and masking, one using the ternary operator.
    • parity โ€” compute the parity of a 32 bit unsigned integer. Computed five ways, two using bit counting, one using multiplication, shifting and xor'ing, one using shifting and xor'ing, one using a builtin parity function.
    • pwr2 โ€” determine if a 32 bit unsigned integer is a power of 2. Computed using bit counting and with a mask of value โˆ’ 1.
    • rnddnpwr2 โ€” find the nearest power of 2 of a 32 bit unsigned integer, rounded down. Computed three ways, one using bit counting and shifting, one using shifting and or'ing, one using a shift and the builtin ctz function.
    • rnduppwr2 โ€” find the nearest power of 2 of a 32 bit unsigned integer, rounded up. Computed three ways, one using bit counting and shifting, one using shifting and or'ing, one using a shift and the builtin ctz function.
    • reverse โ€” reverse the bits of a 32 bit unsigned integer. Computed six ways, one using bit shifting loop, one using bit shifting and mask loop, one using parallelised masking and shifting, one using 64 bit multiplication, one using 32 bit multiplication, one using the builtin bitreverse32 function. ๐Ÿ’ซ
    • sign โ€” calculate the sign of a 32 bit signed integer. Computed two ways, one using a branchless less than zero operator, one using sign bit shifting and negation.
    • swap โ€” swap two 32 bit signed integers without a temporary variable. Computed two ways, one using subtraction and addition, one using xor'ing.
    • zerobyte โ€” determine of a 32 bit unsigned integer contains one or more zero bytes. Computed two ways, one with per byte zero checking, one using bit masking.

๐ŸŒˆ Berkeley Packet Filter (BPF) stressor ๐Ÿ’…

  • --bpf N โ€” spin up N workers that generate BPF instructions for the bpf(2) system call so they can get verified and JIT'd, bestie. The BPF code generator recursively tries to extend a generated BPF program up to a default of 2048 bpf instructions, and the code generation lowkey attempts to work through both valid and invalid BPF instruction encodings. it's giving "chaos but make it educational" โœจ
  • --bpf-max N โ€” set the maximum number of BPF instructions to generate for the BPF code. minimum is 2, maximum is 1048576. no cap on the range knowledge ๐ŸŽ€
  • --bpf-ops N โ€” stop after N bpf(2) system calls. periodt.

๐ŸŒธ Branch stressor ๐Ÿฆ‹

  • --branch N โ€” start N workers that randomly branch to 1024 randomly selected locations, which means they're out here exercising the CPU branch prediction logic fr fr ๐Ÿ”ฅ
  • --branch-jumps [ 64 | 128 | 256 | 512 | 1024 | 2048 ] โ€” specify the maximum number of jump targets to use. larger values increase the potential for higher branch miss rates ๐Ÿ‘€
  • --branch-ops N โ€” stop the branch stressors after N ร— 1024 branches. math girlie behavior ๐Ÿ’…

๐ŸŽ€ Brk stressor ๐Ÿ’–

  • --brk N โ€” start N workers that grow the data segment by one page at a time using multiple brk(2) calls. every successfully allocated new page gets touched so we know it's resident in memory. if an out of memory condition happens, the test resets the data segment back to the point before it started and repeats the whole data segment resizing over again. the process adjusts the out of memory setting so it may be killed by the out of memory (OOM) killer before other processes โ€” so if it gets OOM-killed, a monitoring parent process automatically restarts it. main character resilience honestly ๐Ÿ˜ญ
  • --brk-bytes N โ€” maximum brk growth as N bytes per brk worker. you can specify the size as % of total available memory, or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g โœจ
  • --brk-mlock โ€” attempt to mlock(2) future brk pages into memory, which causes more memory pressure. if mlock(MCL_FUTURE) is implemented then this stops new brk pages from being swapped out ๐Ÿซถ
  • --brk-notouch โ€” do not touch each newly allocated data segment page. this disables the default of touching each newly allocated page, and hence avoids the kernel from necessarily backing the page with physical memory ๐Ÿ™ˆ
  • --brk-ops N โ€” stop the brk workers after N bogo brk operations.

๐Ÿงš Binary search stressor โญ

  • --bsearch N โ€” start N workers that binary search a sorted array of 32 bit integers using bsearch(3). by default there are 65536 elements in the array. this is a genuinely useful method to exercise random access of memory and processor cache ๐Ÿ”ฅ
  • --bsearch-method [ bsearch-libc | bsearch-nonlibc | ternary ] โ€” pick either the libc implementation of bsearch, a slightly optimized non-libc implementation of bsearch, or a 3-way ternary search. the default is the libc implementation if it exists, otherwise the non-libc version ๐Ÿ’…
  • --bsearch-ops N โ€” stop the bsearch worker after N bogo bsearch operations are completed.
  • --bsearch-size N โ€” specify the size (number of 32 bit integers) in the array to bsearch. size can be from 1 K to 64 M. big array energy ๐ŸŒˆ

๐Ÿ“ bubblesort stressor ๐Ÿ’€

  • --bubblesort N โ€” start N workers that sort 32 bit integers using bubblesort. yes, that bubblesort. we're doing it on purpose, it's a stress test, chill ๐Ÿ˜ญ
  • --bubblesort-method [ bubblesort-fast | bubblesort-naive ] โ€” select either a standard optimized implementation of bubblesort or a naรฏve unoptimized implementation of bubblesort. the default is the standard optimized version ๐ŸŽ€
  • --bubblesort-ops N โ€” stop bubblesort stress workers after N bogo bubblesorts.
  • --bubblesort-size N โ€” specify the number of 32 bit integers to sort, default is 16384.

๐Ÿ’œ Cache stressor ๐Ÿ‘‘

  • -C N, --cache N โ€” start N workers that perform random wide spread memory reads and writes to thrash the CPU cache. heads up: the code does not intelligently determine the CPU cache configuration, so it may be sub-optimal at producing hit-miss read/write activity on some processors. also, if you actually want to exercise cache misses, the recommendation is to use the matrix-3d stressor with the --matrix-3d-zyx option instead ๐Ÿซถ
  • --cache-badpage โ€” periodically cache flush on an unmapped (bad) page. chaotic, love that for us ๐Ÿฆ‹
  • --cache-cldemote โ€” cache line demote (x86 only). this is a no-op for non-x86 architectures and for older x86 processors that don't support this feature.
  • --cache-clflushopt โ€” use optimized cache line flush (x86 only). this is a no-op for non-x86 architectures and older x86 processors that don't support this feature.
  • --cache-clwb โ€” cache line writeback (x86 only). this is a no-op for non-x86 architectures and older x86 processors that don't support this feature.
  • --cache-enable-all โ€” where appropriate, exercise the cache using cldemote, clflushopt, fence, flush, sfence and prefetch. the full menu, basically โœจ
  • --cache-fence โ€” force write serialization on each store operation (x86 only). this is a no-op for non-x86 architectures.
  • --cache-flush โ€” force flush cache on each store operation (x86 only). this is a no-op for non-x86 architectures.
  • --cache-level N โ€” specify the level of cache to exercise (1 = L1 cache, 2 = L2 cache, 3 = L3/LLC cache, which is the default). if the cache hierarchy can't be determined, built-in defaults apply ๐ŸŒธ
  • --cache-no-affinity โ€” do not change processor affinity when --cache is in effect.
  • --cache-ops N โ€” stop cache thrash workers after N bogo cache thrash operations.
  • --cache-permute โ€” permute the selected cache flags when exercising cache for an improved mix of cache operations. recommend also using --cache-enable-all with this option ๐Ÿ”ฅ
  • --cache-prefetch โ€” force read prefetch on read address, on architectures that support prefetching.
  • --cache-prefetchw โ€” force a redundant write prefetch, on architectures that support write prefetching.
  • --cache-sfence โ€” force write serialization on each store operation using the sfence instruction (x86 only). this is a no-op for non-x86 architectures.
  • --cache-size N โ€” override the default cache size setting to N bytes. you can specify the units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g ๐Ÿ’…
  • --cache-ways N โ€” specify the number of cache ways to exercise. this lets a subset of the overall cache size get exercised ๐ŸŽ€

๐ŸŒˆ Cache hammering stressor ๐Ÿ”จ

  • --cachehammer N โ€” start N workers that exercise the cache with a randomized mix of memory read/writes and, where possible, cache prefetches and cache flushes to random addresses in three memory mapped regions. one of them is shared among all the cache stressors and is the size of the L3 cache, one is local to each stressor instance and is 4 times the L3 cache size, and one is a single page mapping that cannot be read or written. three region slay ๐Ÿ’…
  • --cachehammer-method [ permute | random ] โ€” specify the memory and cached operations method. the default is random order; permute performs a full permuted mix of memory and cache operations for complete coverage โœจ
  • --cachehammer-numa โ€” periodically assign exercised pages to randomly selected NUMA nodes. this is disabled for systems that do not support NUMA.
  • --cachehammer-ops N โ€” stop after N cache hammer operations.

๐Ÿฆ‹ Cache line stressor ๐Ÿ’–

  • --cacheline N โ€” start N workers that exercise reading and writing individual bytes in a shared buffer that is the size of a cache line. each stressor runs 1 or more processes to exercise bytes that are next to each other. the number of per-stressor processes run is scaled so that at least all N bytes of an N byte cache line get exercised. the whole intent is to try and trigger cacheline corruption, stalls and misses with shared memory accesses ๐Ÿ˜ญ
  • --cacheline-affinity โ€” frequently change CPU affinity, spreading cacheline processes evenly across all online CPUs to try and maximize lower-level cache activity. attempts to keep adjacent cachelines being exercised by adjacent CPUs ๐Ÿซถ
  • --cacheline-method method โ€” specify a cacheline stress method. by default all the stress methods are exercised sequentially, but you can specify just one method to be used if you need to. available cacheline stress methods are described as follows:

okay so here's the full menu of methods you can pick from, bestie โ€” every single one, no skipping:

  • all โ€” iterate over all the below CPU stress methods.
  • adjacent โ€” increment a specific byte in a cacheline and read the adjacent byte, check for corruption every 7 increments.
  • atomicinc โ€” atomically increment a specific byte in a cacheline and check for corruption every 7 increments.
  • bits โ€” write and read back shifted bit patterns into specific byte in a cacheline and check for corruption.
  • copy โ€” copy an adjacent byte to a specific byte in a cacheline.
  • inc โ€” increment and read back a specific byte in a cacheline and check for corruption every 7 increments.
  • mix โ€” perform a mix of increment, left and right rotates a specific byte in a cacheline and check for corruption.
  • rdfwd64 โ€” increment a specific byte in a cacheline and then read in forward direction an entire cacheline using 64 bit reads.
  • rdints โ€” increment a specific byte in a cacheline and then read data at that byte location in naturally aligned locations integer values of size 8, 16, 32, 64 and 128 bits.
  • rdrev64 โ€” increment a specific byte in a cacheline and then read in reverse direction an entire cacheline using 64 bit reads.
  • rdwr โ€” read and write the same 8 bit value into a specific byte in a cacheline and check for corruption.
  • --cacheline-ops N โ€” stop cacheline workers after N loops of the byte exercising in a cacheline.

โœจ Process capabilities stressor โœจ

  • --cap N โ€” start N workers that exercise per process capabilities via calls to capget(2) and capset(2), (Linux only).
  • --cap-ops N โ€” stop after N capset/capget bogo operations.

๐ŸŽ€ Cgroup stressor ๐ŸŽ€

  • --cgroup N โ€” start N workers that mount a cgroup, move a child to the cgroup, read, write and remove the child from the cgroup and umount the cgroup per bogo-op iteration. This uses cgroup v2 and is only available for Linux systems.
  • --cgroup-ops N โ€” stop after N cgroup bogo operations.

๐ŸŒธ Chattr stressor ๐ŸŒธ

  • --chattr N โ€” start N workers that attempt to exercise file attributes via the EXT2_IOC_SETFLAGS ioctl(2). This is intended to be intentionally racy and exercise a range of chattr attributes by enabling and disabling them on a file shared amongst the N chattr stressor processes. (Linux only).
  • --chattr-ops N โ€” stop after N chattr bogo operations.

๐Ÿฆ‹ Chdir stressor ๐Ÿฆ‹

  • --chdir N โ€” start N workers that change directory between directories using chdir(2).
  • --chdir-dirs N โ€” exercise chdir on N directories. The default is 8192 directories, this allows 64 to 65536 directories to be used instead.
  • --chdir-ops N โ€” stop after N chdir bogo operations.

๐Ÿ’… Chmod stressor ๐Ÿ’…

  • --chmod N โ€” start N workers that change the file mode bits via chmod(2) and fchmod(2) on the same file. The greater the value for N then the more contention on the single file. The stressor will work through all the combinations of mode bits.
  • --chmod-ops N โ€” stop after N chmod bogo operations.

๐Ÿ’– Chown stressor ๐Ÿ’–

  • --chown N โ€” start N workers that exercise chown(2) on the same file. The greater the value for N then the more contention on the single file.
  • --chown-ops N โ€” stop the chown workers after N bogo chown(2) operations.

๐Ÿ”ฅ Chroot stressor ๐Ÿ”ฅ

  • --chroot N โ€” start N workers that exercise chroot(2) on various valid and invalid chroot paths. Only available on Linux systems and requires the CAP_SYS_ADMIN capability.
  • --chroot-ops N โ€” stop the chroot workers after N bogo chroot(2) operations.

๐ŸŒˆ Complex hyperbolic functions stressor ๐ŸŒˆ

  • --chyperbolic N โ€” start N workers that exercise complex sinh, cosh, and tanh libm complex hyperbolic functions using complex float, complex double and complex long double floating point variants. Each function is exercised 10000 times per bogo-operation.
  • --chyperbolic-method function โ€” specify a complex hyperbolic stress function. By default, all the functions are exercised sequentially, however one can specify just one function to be used if required. Available options are as follows:
    • all โ€” iterate through all of the following complex hyperbolic functions
    • ccosh โ€” complex hyperbolic cosine (complex double precision)
    • ccoshf โ€” complex hyperbolic cosine (complex float precision)
    • ccoshl โ€” complex hyperbolic cosine (complex long double precision)
    • csinh โ€” complex hyperbolic sine (complex double precision)
    • csinhf โ€” complex hyperbolic sine (complex float precision)
    • csinhl โ€” complex hyperbolic sine (complex long double precision)
    • ctanh โ€” complex hyperbolic tangent (complex double precision)
    • ctanhf โ€” complex hyperbolic tangent (complex float precision)
    • ctanhl โ€” complex hyperbolic tangent (complex long double precision)
  • --chyperbolic-ops N โ€” stop after N bogo-operations.

โญ Clock stressor โญ

  • --clock N โ€” start N workers exercising clocks and POSIX timers. For all known clock types this will exercise clock_getres(2), clock_gettime(2) and clock_nanosleep(2). For all known timers it will create a random duration timer and busy poll this until it expires. This stressor will cause frequent context switching.
  • --clock-ops N โ€” stop clock stress workers after N bogo operations.

๐Ÿงš Clone stressor ๐Ÿงš

  • --clone N โ€” start N workers that create clones (via the clone(2) and clone3(2) system calls). This will rapidly try to create a default of 8192 clones that immediately die and wait in a zombie state until they are reaped. When the maximum number of clones is reached (or clone fails because one has reached the maximum allowed) the oldest clone thread is reaped and a new clone is then created in a first-in first-out manner, and then repeated. A random clone flag is selected for each clone to try to exercise different clone operations. The clone stressor is a Linux only option.
  • --clone-max N โ€” try to create as many as N clone threads. This may not be reached if the system limit is less than N.
  • --clone-ops N โ€” stop clone stress workers after N bogo clone operations.

๐Ÿ“ Close stressor ๐Ÿ“

  • --close N โ€” start N workers that try to force race conditions on closing opened file descriptors. These file descriptors have been opened in various ways to try and exercise different kernel close handlers.
  • --close-fds N โ€” specify the number of fds to close, the range is from 2 to 65535, with a default of 8.
  • --close-ops N โ€” stop close workers after N bogo close operations.

๐Ÿ’œ Swapcontext stressor ๐Ÿ’œ

  • --context N โ€” start N workers that run three threads that use swapcontext(3) to implement the thread-to-thread context switching. This exercises rapid process context saving and restoring and is bandwidth limited by register and memory save and restore rates.
  • --context-ops N โ€” stop context workers after N bogo context switches. In this stressor, 1 bogo op is equivalent to 1000 swapcontext calls.

๐Ÿซถ Copy file stressor ๐Ÿซถ

  • --copy-file N โ€” start N stressors that copy a file using the Linux copy_file_range(2) system call. 128 KB chunks of data are copied from random locations from one file to random locations to a destination file. By default, the files are 256 MB in size. Data is sync'd to the filesystem after each copy_file_range(2) call.
  • --copy-file-bytes N โ€” copy file size, the default is 256 MB. One can specify the size as % of free space on the file system or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g.
  • --copy-file-io-bytes N โ€” copy_file_range(2) copying I/O size, the default is 128 KB, range 4 K to 1 MB.
  • --copy-file-ops N โ€” stop after N copy_file_range() calls.

๐Ÿ‘‘ CPU stressor ๐Ÿ‘‘

  • -c N, --cpu N โ€” start N workers exercising the CPU by sequentially working through all the different CPU stress methods. Instead of exercising all the CPU stress methods, one can specify a specific CPU stress method with the --cpu-method option.
  • -l P, --cpu-load P โ€” load CPU with P percent loading for the CPU stress workers. 0 is effectively a sleep (no load) and 100 is full loading. The loading loop is broken into compute time (load%) and sleep time (100% - load%). Accuracy depends on the overall load of the processor and the responsiveness of the scheduler, so the actual load may be different from the desired load. Note that the number of bogo CPU operations may not be linearly scaled with the load as some systems employ CPU frequency scaling and so heavier loads produce an increased CPU frequency and greater CPU bogo operations.
Heads up bestie: this note only applies to the --cpu stressor option and not to all of the CPU class of stressors. ๐Ÿ’…
  • --cpu-load-slice S โ€” okay so this one's only useful when --cpu-load is less than 100%, because that's when the CPU load gets broken up into a bunch of busy cycles and idle cycles. Use this to say how long a busy time slice lasts. Here's the tea on S:
    • A negative value for S = the number of iterations to run before idling the CPU (so -30 invokes 30 iterations of a CPU stress loop). ๐Ÿ”
    • A zero value = pick a random busy time between 0 and 0.5 seconds. ๐ŸŽฒ
    • A positive value for S = the number of milliseconds to run before idling the CPU (so 100 keeps the CPU busy for 0.1 seconds). โฑ๏ธ

Small values for S give you small time slices and smoother scheduling โ€” it's giving โœจgracefulโœจ. Setting --cpu-load nice and low while --cpu-load-slice is large will cycle the CPU between long idle and busy cycles, which exercises different CPU frequencies. The thermal range of the CPU gets cycled too, so this is a genuinely good mechanism for exercising the scheduler, frequency scaling, and passive/active thermal cooling mechanisms. ๐Ÿ”ฅ๐ŸงŠ

Note: this option only applies to the --cpu stressor option and not to all of the CPU class of stressors.
  • --cpu-method method โ€” pick a specific CPU stress method, bestie. By default all the stress methods get exercised sequentially, but if you need just one, you can specify it. ๐ŸŽฏ The available CPU stress methods are described as follows:

okay, continuing the method list โ€” buckle up bestie, this is a long one ๐Ÿ’…

  • all โ€” iterate over all the below CPU stress methods
  • ackermann โ€” Ackermann function: compute A(3, 7), where:
A(m, n) = n + 1 if m = 0;
A(m โˆ’ 1, 1) if m > 0 and n = 0;
A(m โˆ’ 1, A(m, n โˆ’ 1)) if m > 0 and n > 0

For other recursive methods, refer to the hanoi CPU stress method.

  • apery โ€” calculate Apery's constant ฮถ(3); the sum of 1/(n โ†‘ 3) to a precision of 1.0x10โ†‘14
  • bitops โ€” various bit operations from bithack, namely: reverse bits, parity check, bit count, round to nearest power of 2
  • callfunc โ€” recursively call 8 argument C function to a depth of 1024 calls and unwind
  • cfloat โ€” 1000 iterations of a mix of floating point complex operations
  • cdouble โ€” 1000 iterations of a mix of double floating point complex operations
  • clongdouble โ€” 1000 iterations of a mix of long double floating point complex operations
  • collatz โ€” compute the 1348 steps in the collatz sequence starting from number 989345275647. Where f(n) = n / 2 (for even n) and f(n) = 3n + 1 (for odd n).
  • correlate โ€” perform a 8192 ร— 512 correlation of random doubles
  • crc16 โ€” compute 1024 rounds of CCITT CRC16 on random data ๐ŸŽ€
  • decimal32 โ€” 1000 iterations of a mix of 32 bit decimal floating point operations (GCC only)
  • decimal64 โ€” 1000 iterations of a mix of 64 bit decimal floating point operations (GCC only)
  • decimal128 โ€” 1000 iterations of a mix of 128 bit decimal floating point operations (GCC only)
  • dither โ€” Floyd-Steinberg dithering of a 1024 ร— 768 random image from 8 bits down to 1 bit of depth
  • div8 โ€” 50000 8 bit unsigned integer divisions
  • div16 โ€” 50000 16 bit unsigned integer divisions
  • div32 โ€” 50000 32 bit unsigned integer divisions
  • div64 โ€” 50000 64 bit unsigned integer divisions
  • div128 โ€” 50000 128 bit unsigned integer divisions
  • double โ€” 1000 iterations of a mix of double precision floating point operations
  • euler โ€” compute e using n = (1 + (1 รท n)) โ†‘ n
  • explog โ€” iterate on n = exp(log(n) รท 1.00002)
  • factorial โ€” find factorials from 1..150 using Stirling's and Ramanujan's approximations
  • fibonacci โ€” compute Fibonacci sequence of 0, 1, 1, 2, 5, 8...
  • fft โ€” 4096 sample Fast Fourier Transform โœจ
  • fletcher16 โ€” 1024 rounds of a naรฏve implementation of a 16 bit Fletcher's checksum
  • float โ€” 1000 iterations of a mix of floating point operations
  • float16 โ€” 1000 iterations of a mix of 16 bit floating point operations
  • float32 โ€” 1000 iterations of a mix of 32 bit floating point operations
  • float64 โ€” 1000 iterations of a mix of 64 bit floating point operations
  • float80 โ€” 1000 iterations of a mix of 80 bit floating point operations
  • float128 โ€” 1000 iterations of a mix of 128 bit floating point operations
  • floatconversion โ€” perform 65536 iterations of floating point conversions between float, double and long double floating point variables.
  • gamma โ€” calculate the Euler-Mascheroni constant ฮณ using the limiting difference between the harmonic series (1 + 1/2 + 1/3 + 1/4 + 1/5 ... + 1/n) and the natural logarithm ln(n), for n = 80000.
  • gcd โ€” compute GCD of integers
  • gray โ€” calculate binary to gray code and gray code back to binary for integers from 0 to 65535
  • hamming โ€” compute Hamming H(8,4) codes on 262144 lots of 4 bit data. This turns 4 bit data into 8 bit Hamming code containing 4 parity bits. For data bits d1..d4, parity bits are computed as:
p1 = d2 + d3 + d4
p2 = d1 + d3 + d4
p3 = d1 + d2 + d4
p4 = d1 + d2 + d3
  • hanoi โ€” solve a 21 disc Towers of Hanoi stack using the recursive solution. For other recursive methods, refer to the ackermann CPU stress method.
  • hyperbolic โ€” compute sinh(ฮธ) ร— cosh(ฮธ) + sinh(2ฮธ) + cosh(3ฮธ) for float, double and long double hyperbolic sine and cosine functions where ฮธ = 0 to 2ฯ€ in 1500 steps ๐Ÿฆ‹
  • idct โ€” 8 ร— 8 IDCT (Inverse Discrete Cosine Transform).
  • int8 โ€” 1000 iterations of a mix of 8 bit integer operations.
  • int16 โ€” 1000 iterations of a mix of 16 bit integer operations.
  • int32 โ€” 1000 iterations of a mix of 32 bit integer operations.
  • int64 โ€” 1000 iterations of a mix of 64 bit integer operations.
  • int128 โ€” 1000 iterations of a mix of 128 bit integer operations (GCC only).
  • int32float โ€” 1000 iterations of a mix of 32 bit integer and floating point operations.
  • int32double โ€” 1000 iterations of a mix of 32 bit integer and double precision floating point operations.
  • int32longdouble โ€” 1000 iterations of a mix of 32 bit integer and long double precision floating point operations.
  • int64float โ€” 1000 iterations of a mix of 64 bit integer and floating point operations.
  • int64double โ€” 1000 iterations of a mix of 64 bit integer and double precision floating point operations.
  • int64longdouble โ€” 1000 iterations of a mix of 64 bit integer and long double precision floating point operations.
  • int128float โ€” 1000 iterations of a mix of 128 bit integer and floating point operations (GCC only).
  • int128double โ€” 1000 iterations of a mix of 128 bit integer and double precision floating point operations (GCC only).
  • int128longdouble โ€” 1000 iterations of a mix of 128 bit integer and long double precision floating point operations (GCC only).
  • int128decimal32 โ€” 1000 iterations of a mix of 128 bit integer and 32 bit decimal floating point operations (GCC only).
  • int128decimal64 โ€” 1000 iterations of a mix of 128 bit integer and 64 bit decimal floating point operations (GCC only).
  • int128decimal128 โ€” 1000 iterations of a mix of 128 bit integer and 128 bit decimal floating point operations (GCC only).
  • intconversion โ€” perform 65536 iterations of integer conversions between int16, int32 and int64 variables.
  • ipv4checksum โ€” compute 1024 rounds of the 16 bit ones' complement IPv4 checksum.
  • jmp โ€” Simple unoptimised compare >, <, == and jmp branching.
  • lfsr32 โ€” 16384 iterations of a 32 bit Galois linear feedback shift register using the polynomial xโ†‘32 + xโ†‘31 + xโ†‘29 + x + 1. This generates a ring of 2โ†‘32 โˆ’ 1 unique values (all 32 bit values except for 0).
  • ln2 โ€” compute ln(2) based on series: 1 โˆ’ 1/2 + 1/3 โˆ’ 1/4 + 1/5 โˆ’ 1/6 ...
  • logmap โ€” 16384 iterations computing chaotic double precision values using the logistic map ฮงn+1 = r ร— ฮงn ร— (1 โˆ’ ฮงn) where r > โˆผ 3.56994567
  • longdouble โ€” 1000 iterations of a mix of long double precision floating point operations.
  • loop โ€” simple empty loop. (yes literally. iconic behaviour honestly ๐Ÿ’€)
  • matrixprod โ€” matrix product of two 128 ร— 128 matrices of double floats. Testing on 64 bit x86 hardware shows that this is provides a good mix of memory, cache and floating point operations and is probably the best

โ€ฆCPU method to use to make a CPU run hot. <span>๐Ÿ“</span>

  • nsqrt โ€” compute sqrt() of long doubles using Newton-Raphson.
  • omega โ€” compute the omega constant defined by ฮฉeโ†‘ฮฉ = 1 using efficient iteration of ฮฉn+1 = (1 + ฮฉn) / (1 + eโ†‘ฮฉn).
  • parity โ€” compute parity using various methods from the Standford Bit Twiddling Hacks. Methods employed are: the naรฏve way, the naรฏve way with the Brian Kernigan bit counting optimisation, the multiply way, the parallel way, the lookup table ways (2 variations) and using the __builtin_parity(3) function.
  • phi โ€” compute the Golden Ratio ฯ• using series.
  • pi โ€” compute ฯ€ using the Srinivasa Ramanujan fast convergence algorithm.
  • prime โ€” find the first 10000 prime numbers using a slightly optimised brute force naรฏve trial division search.
  • psi โ€” compute ฯˆ (the reciprocal Fibonacci constant) using the sum of the reciprocals of the Fibonacci numbers.
  • queens โ€” compute all the solutions of the classic 8 queens problem for board sizes 1..11.
  • rand โ€” 16384 iterations of rand(), where rand is the MWC pseudo random number generator. The MWC random function concatenates two 16 bit multiply-with-carry generators:
x(n) = 36969 ร— x(n โˆ’ 1) + carry,
y(n) = 18000 ร— y(n โˆ’ 1) + carry mod 2 โ†‘ 16

and has period of around 2 โ†‘ 60. <span>๐Ÿ’ซ</span>

  • rand48 โ€” 16384 iterations of drand48(3) and lrand48(3).
  • rgb โ€” convert RGB to YUV and back to RGB (CCIR 601).
  • sieve โ€” find the first 10000 prime numbers using the sieve of Eratosthenes.
  • stats โ€” calculate minimum, maximum, arithmetic mean, geometric mean, harmoninc mean and standard deviation on 250 randomly generated positive double precision values.
  • sqrt โ€” compute sqrt(rand()), where rand is the MWC pseudo random number generator.
  • trig โ€” compute sin(ฮธ) ร— cos(ฮธ) + sin(2ฮธ) + cos(3ฮธ) for float, double and long double sine and cosine functions where ฮธ = 0 to 2ฯ€ in 1500 steps.
  • union โ€” perform integer arithmetic on a mix of bit fields in a C union. This exercises how well the compiler and CPU can perform integer bit field loads and stores.
  • zeta โ€” compute the Riemann Zeta function ฮถ(s) for s = 2.0..10.0

Okay so quick reality check, bestie <span>๐Ÿซถ</span> โ€” some of these methods try to exercise the CPU with computations found in some real world use cases. BUT. The code has not been optimised on a per-architecture basis, so may be a sub-optimal compared to hand-optimised code used in some applications. They do try to represent the typical instruction mixes found in these use cases. No cap, that's the whole disclaimer. <span>๐Ÿ˜ญ</span>


  • --cpu-old-metrics โ€” as of version V0.14.02 the CPU stressor now normalizes each of the CPU stressor method bogo-op counters to try and ensure a similar bogo-op rate for all the methods to avoid the shorter running (and faster) methods from skewing the bogo-op rates when using the default "all" method. This is based on a reference Intel i5-8350U processor and hence the bogo-ops normalizing factors will be skew somewhat on different CPUs, but so significantly as the original bogo-op counter rates. To disable the normalization and fall back to the original metrics, use this option. <span>๐ŸŽ€</span>
  • --cpu-ops N โ€” stop CPU stress workers after N bogo operations.

๐Ÿ–ฅ๏ธ CPU onlining stressor <span>โœจ</span>

  • --cpu-online N โ€” start N workers that put randomly selected CPUs offline and online. This Linux only stressor requires root privilege to perform this action. By default the first CPU (CPU 0) is never offlined as this has been found to be problematic on some systems and can result in a shutdown. <span>๐Ÿ’€</span>
  • --cpu-online-affinity โ€” move the stressor worker to the CPU that will be next offlined.
  • --cpu-online-all โ€” The default is to never offline the first CPU. This option will offline and online all the CPUs including CPU 0. This may cause some systems to shutdown. <span>๐Ÿ”ฅ</span>
  • --cpu-online-ops N โ€” stop after offline/online operations.

๐Ÿงš CPU affinity scheduler stressor <span>๐Ÿฆ‹</span>

  • --cpu-sched N โ€” start N workers that exercise the scheduler by moving processes to different CPUs. Each worker starts 16 child processes and repeatedly moves the processes to different CPUs and attempts changes their scheduler policy using SCHED_OTHER, SCHED_BATCH, SCHED_IDLE, SCHED_EXT, SCHED_DEADLINE, SCHED_RR and SCHED_FIFO policies. The choice of CPU placement is based on 8 different mechanisms and is changed every second to mix process placements on all the available CPUS. The child processes are run with randomized nice settings to exercise scheduler prioritization. <span>๐Ÿ‘‘</span>
  • --cpu-sched-ops N โ€” stop after N child process move attempts.
  • --cpu-sched-procs N โ€” specify number of child processes that each worker controls. The range is from 2 to 1024 with a default of 16.

๐ŸŒ€ Cyclic Redundancy Check stressor <span>๐ŸŒˆ</span>

  • --crc N โ€” start N workers that perform a range of CRC calculations on 1024 bits of data. Where available the gcc __builtin_crc functions are used to calculate the CRCs. The following forward and reverse CRCs are exercised: <span>โญ</span>
    • crc8_data8 โ€” 8 bit CRC with 128 ร— 8 bit data
    • crc16_data8 โ€” 16 bit CRC with 128 ร— 8 bit data
    • crc16_data16 โ€” 16 bit CRC with 64 ร— 16 bit data
    • crc32_data8 โ€” 32 bit CRC with 128 ร— 8 bit data
    • crc32_data16 โ€” 32 bit CRC with 64 ร— 16 bit data
    • crc32_data32 โ€” 32 bit CRC with 32 ร— 32 bit data
    • crc64_data8 โ€” 64 bit CRC with 128 ร— 8 bit data
    • crc64_data16 โ€” 64 bit CRC with 64 ร— 16 bit data
    • crc64_data32 โ€” 64 bit CRC with 32 ร— 32 bit data
    • crc64_data64 โ€” 64 bit CRC with 16 ร— 64 bit data
  • --crc-ops N โ€” stop after N ร— 64 rounds of CRC calculations

๐Ÿ” Crypt stressor <span>๐Ÿ’œ</span>

  • --crypt N โ€” start N workers that encrypt a 16 character random password using crypt(3). The password is encrypted using bcrypt, bsdicrypt, descrypt, gost-yescrypt, MD5, NT, scrypt, SHA-1, SHA-256, SHA-512, SunMD5 and yescrypt encryption methods.
  • --crypt-method method โ€” select the encryption method, may be one of: bcrypt, bsdicrypt, descrypt, gost-yescrypt, MD5, NT, scrypt, SHA-1, SHA-256, SHA-512, SunMD5 and yescrypt. The all method selects all the methods and is the default. <span>๐Ÿ’…</span>
  • --crypt-ops N โ€” stop after N bogo encryption operations.

๐ŸŒธ Complex trigonometric functions stressor <span>๐Ÿงฎ</span>

  • --ctrig N โ€” start N workers that exercise complex sin, complex cos and complex tan libm trigonometric functions using complex float, complex double and complex long double floating point variants. Each function is exercised 10000 times per bogo-operation.
  • --ctrig-method function โ€” specify a trigonometric stress function. By default, all the functions are exercised sequentially, however one can specify just one function to be used if required. Available options are as follows: <span>โœจ</span>
    • all โ€” iterate through all of the following complex trigonometric functions
    • ccos โ€” complex cosine (complex double precision)
    • ccosf โ€” complex cosine (complex float precision)
    • ccosl โ€” complex cosine (complex long double precision)
    • csin โ€” complex sine (complex double precision)
    • csinf โ€” complex sine (complex float precision)
    • csinl โ€” complex sine (complex long double precision)
    • ctan โ€” complex tangent (complex double precision)
    • ctanf โ€” complex tangent (complex float precision)
    • ctanl โ€” complex tangent (complex long double precision)
  • --ctrig-ops N โ€” stop after N bogo-operations.

๐ŸŽก Cyclic stressor <span>๐ŸŽ </span>

  • --cyclic N โ€” start N workers that exercise schedulers with cyclic nanosecond sleeps. Normally one would just use 1 worker instance with this stressor to get reliable statistics. By default this stressor measures the first 10 thousand latencies and calculates the mean, mode, minimum, maximum latencies along with various latency percentiles for the just the first cyclic stressor instance. One has to run this stressor with CAP_SYS_NICE capability to enable the real time scheduling policies. The FIFO scheduling policy is the default. <span>๐Ÿ‘‘</span>
  • --cyclic-budget N โ€” this one's the vibe check for your latency ๐Ÿ’…: it fails the stressor if the max measured latency goes over N nanoseconds. So the cyclic stressor can literally be a pass/fail latency check โ€” like, "hey, does my real time task still hit its worst case latency requirement while all this other workload is running?" and now you have an answer. no cap.
  • --cyclic-dist N โ€” calculates and prints a latency distribution with the interval of N nanoseconds โœจ. Super helpful to see where the latencies are clustering (iykyk).
  • --cyclic-method [ clock_ns | itimer | poll | posix_ns | pselect | usleep ] โ€” picks the cyclic method to use, and the default is clock_ns. The available methods are, bestie:
    • clock_ns โ€” sleep for the specified time using the clock_nanosleep(2) high resolution nanosleep and the CLOCK_REALTIME real time clock.
    • itimer โ€” wakeup a paused process with a CLOCK_REALTIME itimer signal.
    • poll โ€” delay for the specified time using a poll delay loop that checks for time changes using clock_gettime(2) on the CLOCK_REALTIME clock.
    • posix_ns โ€” sleep for the specified time using the POSIX nanosleep(2) high resolution nanosleep.
    • pselect โ€” sleep for the specified time using pselect(2) with null file descriptors.
    • usleep โ€” sleep to the nearest microsecond using usleep(2).
  • --cyclic-ops N โ€” stop after N sleeps ๐Ÿ˜ด.
  • --cyclic-policy [ batch | deadline | ext | fifo | idle | other | rr ] โ€” sets the scheduling policy you want ๐ŸŽ€: batch, deadline, ext, fifo (first-in, first-out), idle, other or rr (round-robin).
  • --cyclic-prio P โ€” sets the scheduling priority P. Range goes from 1 (lowest) to 100 (highest) โ€” know your power level ๐Ÿ‘‘.
  • --cyclic-samples N โ€” measure N samples ๐Ÿงช. Range from 1 to 100000000 samples.
  • --cyclic-sleep N โ€” sleep for N nanoseconds per test cycle using clock_nanosleep(2) with the CLOCK_REALTIME timer. Range from 1 to 1000000000 nanoseconds โฑ๏ธ.

๐ŸงŸ Daemon stressor ๐ŸงŸ

  • --daemon N โ€” start N workers that each create a daemon that dies immediately after creating another daemon and so on ๐Ÿ˜ญ. This effectively works through the process table with short lived processes that don't have a parent and are waited for by init. It puts pressure on init to do rapid child reaping. The daemon processes do the usual mix of calls to turn into typical UNIX daemons, so it artificially mimics very heavy daemon system stress. it's giving chaos ๐ŸŒ€.
  • --daemon-bloat N โ€” sets the daemon's memory mapping bloat size in bytes ๐Ÿซง. This simulates memory usage by a daemon process; default is zero (no memory mapping), range 4K to 64MB.
  • --daemon-ops N โ€” stop daemon workers after N daemons have been created.
  • --daemon-wait โ€” wait for daemon child processes rather than let init handle the waiting ๐Ÿ™ˆ. Heads up: enabling this option will reduce the daemon fork rate because of the synchronous wait delays. lowkey a tradeoff, fr fr.

๐Ÿ“จ Datagram congestion control protocol (DCCP) stressor ๐Ÿ“จ

  • --dccp N โ€” start N workers that send and receive data using the Datagram Congestion Control Protocol (DCCP) (RFC4340) ๐ŸŒˆ. This involves a pair of client/server processes performing rapid connects, sends, receives and disconnects on the local host.
  • --dccp-domain D โ€” sets the domain to use; default is ipv4. Right now ipv4 and ipv6 are the supported ones.
  • --dccp-if NAME โ€” use network interface NAME ๐Ÿฆ‹. If the interface NAME doesn't exist, isn't up, or doesn't support the domain, then the loopback (lo) interface is used as the default.
  • --dccp-msgs N โ€” send N messages per connect, send/receive, disconnect iteration. Default is 10000 messages. Fair warning: if N is too small, the rate gets throttled back by the overhead of dccp socket connect and disconnects ๐Ÿ’€.
  • --dccp-port P โ€” start DCCP at port P. For N dccp worker processes, ports P to P + (Nโˆ’1) are used (wrapped to keep in range of 1024 to 65535). Default port is port 49152 ๐Ÿ”Œ.
  • --dccp-ops N โ€” stop dccp stress workers after N bogo operations.
  • --dccp-opts [ send | sendmsg | sendmmsg ] โ€” by default, messages are sent using send(2). This lets you pick the sending method with send(2), sendmsg(2) or sendmmsg(2). Note that sendmmsg is only available for Linux systems that support this system call ๐Ÿง.

๐Ÿ”’ Mutex using Dekker algorithm stressor ๐Ÿ”’

  • --dekker N โ€” start N workers that exercise mutex exclusion between two processes using shared memory with the Dekker Algorithm โœจ. Where possible this uses memory fencing, and falls back to using GCC __sync_synchronize if they're not available. The stressors contain simple mutex and memory coherency sanity checks.
  • --dekker-ops N โ€” stop dekker workers after N mutex operations.

๐Ÿ“‚ Dentry stressor ๐Ÿ“‚

  • -D N, --dentry N โ€” start N workers that create and remove directory entries. This should create file system meta data activity ๐ŸŒธ. The directory entry names are suffixed by a gray-code encoded number to try to mix up the hashing of the namespace โ€” sneaky but iconic.
  • --dentry-negative โ€” access files that don't exist to create negative dentries in the dentry cache ๐Ÿ‘ป. (the void is right there.)
  • --dentry-ops N โ€” stop dentry thrash workers after N bogo dentry operations.
  • --dentry-order [ forward | reverse | stride | random ] โ€” sets the unlink order of dentries, and it can be one of forward, reverse, stride or random ๐ŸŽ€. By default, dentries are unlinked in random order. forward unlinks them from first to last, reverse unlinks them from last to first, stride unlinks them by stepping around order in a quasi-random pattern, and random randomly selects one of forward, reverse or stride orders.
  • --dentries N โ€” create N dentries per dentry thrashing loop, default is 2048.

๐Ÿ•ณ๏ธ Negative dentry cache stressor ๐Ÿ•ณ๏ธ

  • --dentrycache N โ€” start N workers that access non-existent files to fill the dentry cache with negative dentries ๐Ÿ˜ญ. A maximum of 2^64 unique dentry names can be created per stressor instance given enough time. Use the --buddystat or --vmstat option to see memory consumed by the dentry cache. (obsessed with watching memory fill up ngl.)
  • --dentrycache-method [ all | access | getxattr | lstat | open | readlink | stat | utime ] โ€” selects the system call method of creating negative dentries. By default 'all' will cycle through all the methods ๐Ÿ”„.
  • --dentrycache-ops N โ€” stop after N non-existent files are accessed.

๐Ÿ–ฅ๏ธ /dev stressor ๐Ÿ–ฅ๏ธ

  • --dev N โ€” start N workers that exercise the /dev devices ๐Ÿ’…. Each worker runs 5 concurrent threads that perform open(2), fstat(2), lseek(2), poll(2), fcntl(2), mmap(2), munmap(2), fsync(2) and close(2) on the first occurrence of each device. Note that watchdog devices are not exercised โš ๏ธ.
  • --dev-alldev โ€” exercise all devices ๐Ÿฆ‹. The default is just to exercise the first occurrence of a device (e.g. /dev/i2c-0); this option exercises all devices (e.g. /dev/i2c-*) and hence will take far more time to work through all the devices. main character energy, but slow.
  • --dev-file filename โ€” specify the device file to exercise, for example, /dev/null ๐Ÿ•ณ๏ธ. By default the stressor works through all the device files it can find, but this option lets you exercise a single device file.
  • --dev-ops N โ€” stop dev workers after N bogo device exercising operations.

๐Ÿง  /dev/shm stressor ๐Ÿง 

  • --dev-shm N โ€” start N workers that fallocate large files in /dev/shm and then mmap these into memory and touch all the pages ๐Ÿซถ. This exercises pages being moved to/from the buffer cache. Linux only ๐Ÿง.
  • --dev-shm-ops N โ€” stop after N bogo allocation and mmap /dev/shm operations.

๐Ÿ”ข Decimal floating point operations stressor ๐Ÿ”ข

  • --dfp N โ€” start N workers that exercise addition, multiplication and division operations on a range of decimal floating point types โœจ. For each type, 8 floating point values are operated upon 65536 times in a loop per bogo op โ€” math girlie hours fr fr.
  • --dfp-method method โ€” select the decimal floating point method to use; the available methods are:
    • all โ€” iterate over all the following floating point methods:
    • df32add โ€” 32 bit decimal floating point addition (_Decimal32)
    • df64add โ€” 64 bit decimal floating point addition (_Decimal64)
    • df128add โ€” 128 bit decimal floating point addition (_Decimal128)
    • df32sub โ€” 32 bit decimal floating point subtraction (_Decimal32)
    • df64sub โ€” 64 bit decimal floating point subtraction (_Decimal64)
    • df128sub โ€” 128 bit decimal floating point subtraction (_Decimal128)
    • df32mul โ€” 32 bit decimal floating point multiplication (_Decimal32)
    • df64mul โ€” 64 bit decimal floating point multiplication (_Decimal64)
    • df128mul โ€” 128 bit decimal floating point multiplication (_Decimal128)
    • df32div โ€” 32 bit decimal floating point division (_Decimal32)
    • df64div โ€” 64 bit decimal floating point division (_Decimal64)
    • df128div โ€” 128 bit decimal floating point division (_Decimal128)

okay so quick note before we move on: some of these decimal floating point methods are literally not available on every system, so if one ghosts you that's why ๐Ÿ’…

  • --dfp-ops N โ€” stop after N decimal floating point bogo ops. that's it, that's the whole vibe ๐ŸŽ€

๐Ÿ—‚๏ธ Directories stressor

  • --dir N โ€” start N workers that create, rename and remove directories using mkdir(2), rename(2) and rmdir(2). directory chaos on loop, no cap ๐Ÿ”ฅ
  • --dir-dirs N โ€” exercise dir on N directories. the default is 8192 directories, and this lil option lets you go anywhere from 64 to 65536 instead ๐Ÿฆ‹
  • --dir-ops N โ€” stop the directory thrash workers after N bogo directory operations โœจ

๐ŸŒฒ Deep directories stressor

  • --dirdeep N โ€” start N workers that create a depth-first tree of directories to a maximum depth as limited by PATH_MAX or ENAMETOOLONG (whichever occurs first, bestie, it's a race ๐Ÿ’€). by default, each level of the tree contains one directory, but you can bump that up to a max of 10 sub-trees using the --dirdeep-dir option. and to stress inode creation, a symlink and a hardlink to a file at the root of the tree is created in each level. it's giving overachiever ๐ŸŒˆ
  • --dirdeep-bytes N โ€” allocated file size, the default is 0. you can specify the size as % of free space on the file system or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g. this one's used in conjunction with the --dirdeep-files option ๐Ÿ“
  • --dirdeep-dirs N โ€” create N directories at each tree level. the default is just 1 but it can be increased to a maximum of 36 per level ๐Ÿ‘‘
  • --dirdeep-files N โ€” create N files at each tree level. the default is 0, with the file size specified by the --dirdeep-bytes option ๐Ÿ’–
  • --dirdeep-inodes N โ€” consume up to N inodes per dirdeep stressor while creating directories and links. the value N can be the number of inodes or a percentage of the total available free inodes on the filesystem being used ๐Ÿงš
  • --dirdeep-ops N โ€” stop the directory depth workers after N bogo directory operations โญ

๐Ÿ“ Maximum files creation in a directory stressor

  • --dirmany N โ€” start N stressors that create as many files in a directory as possible and then remove them. the file creation phase stops when an error occurs (for example, out of inodes, too many files, quota reached, etc.) and then the files are removed. this cycles until the run time is reached or the file creation count bogo-ops metric is reached. this is a much faster and light weight directory exercising stressor compared to the dentry stressor โ€” lowkey the efficient queen of this whole section ๐Ÿ‘‘โœจ
  • --dirmany-bytes N โ€” allocated file size, the default is 0. one can specify the size as % of free space on the file system or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g ๐Ÿ’…
  • --dirmany-ops N โ€” stop dirmany stressors after N empty files have been created ๐Ÿซถ

๐Ÿ”” Dnotify stressor

  • --dnotify N โ€” start N workers performing file system activities such as making/deleting files/directories, renaming files, etc. to stress exercise the various dnotify events (Linux only ๐Ÿง).
  • --dnotify-ops N โ€” stop dnotify stress workers after N dnotify bogo operations.

๐Ÿซง Dup stressor

  • --dup N โ€” start N workers that perform dup(2) and then close(2) operations on /dev/zero. the maximum opens at one time is system defined, so the test will run up to this maximum, or 65536 open file descriptors, whichever comes first. fd hoarding era ๐ŸŽ€
  • --dup-ops N โ€” stop the dup stress workers after N bogo open operations.

๐Ÿ“š Dynamic libraries loading stressor

  • --dynlib N โ€” start N workers that dynamically load and unload various shared libraries. this exercises memory mapping and dynamic code loading and symbol lookups. see dlopen(3) for more details of this mechanism. very main character energy, libraries going in and out like a revolving door ๐Ÿฆ‹
  • --dynlib-ops N โ€” stop workers after N bogo load/unload cycles.

๐Ÿง  Easy CPU opcode stressor

  • --easy-opcode N โ€” start N workers that exercise 64 continuous pages of randomly selected simple CPU opcodes. for example, for x86 processors this just exercises single byte opcodes such as nop and op-codes that set/clear CPU flags to put pressure on the front-end decoder and instruction cache. for RISC processors opcodes such as nop and simple register moves to/from the same registers are used. smart emulators may remove some of these opcodes (e.g. move r0,r0) and hence opcode rates may be artificially high โ€” so if the numbers look suspiciously slay, that's why ๐Ÿ’€
  • --easy-opcode-ops N โ€” stop after N executions of 64 continuous pages of opcodes.

๐Ÿงฎ Eigen C++ matrix library stressor

  • --eigen N โ€” start N workers that exercise the Eigen C++ matrix library for 2D matrix addition, multiplication, determinant, inverse and transpose operations on long double, double and float matrices. this currently is only available for gcc/g++ builds. math girlies rise ๐ŸŒธ
  • --eigen-method method โ€” select the floating point method to use. available methods are:
    • all โ€” iterate over all the Eigen 2D matrix operations
    • add-longdouble โ€” addition of two matrices of long double floating point values
    • add-double โ€” addition of two matrices of double floating point values
    • add-float โ€” addition of two matrices of floating point values
    • determinant-longdouble โ€” determinant of matrix of long double floating point values
    • determinant-double โ€” determinant of matrix of double floating point values
    • determinant-float โ€” determinant of matrix of floating point values
    • inverse-longdouble โ€” inverse of matrix of long double floating point values
    • inverse-double โ€” inverse of matrix of double floating point values
    • inverse-float โ€” inverse of matrix of floating point values
    • multiply-longdouble โ€” multiplication of two matrices of long double floating point values
    • multiply-double โ€” multiplication of two matrices of double floating point values
    • multiply-float โ€” multiplication of two matrices of floating point values
    • transpose-longdouble โ€” transpose of matrix of long double floating point values
    • transpose-double โ€” transpose of matrix of double floating point values
    • transpose-float โ€” transpose of matrix of floating point values
  • --eigen-ops N โ€” stop after N Eigen matrix computations โœจ
  • --eigen-size N โ€” specify the 2D matrix size N ร— N. the default is a 32 ร— 32 matrix ๐Ÿ’œ

โš™๏ธ EFI variables stressor

  • --efivar N โ€” start N workers that exercise the Linux /sys/firmware/efi/efivars and /sys/firmware/efi/vars interfaces by reading the EFI variables. this is a Linux only stress test for platforms that support the EFI vars interface and may require the CAP_SYS_ADMIN capability. fancy permissions required, bestie, act accordingly ๐Ÿ‘‘
  • --efivar-ops N โ€” stop the efivar stressors after N EFI variable read operations.

๐Ÿšซ Non-functional system call (ENOSYS) stressor

  • --enosys N โ€” start N workers that exercise non-functional system call numbers. this calls a wide range of system call numbers to see if it can break a system where these are not wired up correctly. it also keeps track of system calls that exist (ones that don't return ENOSYS) so that it can focus on purely finding and exercising non-functional system calls. this stressor exercises system calls from 0 to __NR_syscalls + 1024, random system calls within constrained in the ranges of 0 to 2โ†‘8, 2โ†‘16, 2โ†‘24, 2โ†‘32, 2โ†‘40, 2โ†‘48, 2โ†‘56 and 2โ†‘64 bits, high system call numbers and various other bit patterns to try to get wide coverage. and to keep the environment clean, each system call being tested runs in a child process with reduced capabilities. she's thorough, she's polite, she's chaotic ๐ŸŒˆ๐Ÿ’€
  • --enosys-ops N โ€” stop after N bogo enosys system call attempts.

๐ŸŒฑ Environment variables stressor

  • --env N โ€” start N workers that create numerous large environment variables to try to trigger out of memory conditions using setenv(3). if ENOMEM occurs then the environment is emptied and another memory filling retry occurs. the process is restarted if it is killed by the Out Of Memory (OOM) killer. it literally refuses to give up, we love the commitment ๐Ÿ˜ญ๐Ÿซถ
  • --env-ops N โ€” stop after N bogo setenv/unsetenv attempts.

๐ŸŒ€ Epoll stressor

  • --epoll N โ€” start N workers that perform various related socket stress activity using epoll_wait(2) to monitor and handle new connections. this involves client/server processes performing rapid connect, send/receives and disconnects on the local host. using epoll allows a large number of connections to be efficiently handled, however, this can lead to the connection table filling up and blocking further socket connections, hence impacting on the epoll bogo op stats. for ipv4 and ipv6 domains, multiple servers are spawned on multiple ports. the epoll stressor is for Linux only ๐Ÿง๐Ÿ”ฅ
heads up bestie: that connection table filling up thing is real, it's not just a cute lil side note โ€” it will absolutely mess with your stats ๐Ÿ’…
  • --epoll-domain D โ€” tells it which domain to use, bestie. Default is unix (aka local). Right now ipv4, ipv6 and unix are the supported ones. ๐Ÿ’…
  • --epoll-ops N โ€” makes the epoll workers stop after N bogo operations. That's the finish line, periodt. ๐Ÿ
  • --epoll-port P โ€” start at socket port P. For N epoll worker processes, ports P to (P ร— 4) โˆ’ 1 are used for the ipv4 and ipv6 domains, and ports P to P โˆ’ 1 are used for the unix domain. Ports get wrapped to keep in range of 1024 to 65535. The default port is port 49408. โœจ
  • --epoll-sockets N โ€” sets the maximum number of concurrently open sockets allowed in the server. Lowkey a warning though: setting a high value impacts on memory usage and may trigger out of memory conditions. ๐Ÿ˜ญ

๐Ÿ Many epoll file descriptors stressor

  • --epollmany N โ€” starts N workers that exercise many file descriptors using epoll_create1(2) and epoll_ctl(2). Each new epoll file descriptor has up to 16 pipe file descriptors and previously created epoll file descriptors added to it, which creates nested epoll events. This exercises internal kernel epoll lock contention โ€” it's giving kernel stress, honestly. ๐Ÿ”ฅ
  • --epollmany-delete โ€” by default, file descriptors added to an epoll file descriptor are automatically deleted when the file descriptor is closed. This option performs an explicit epoll_ctl(2) EPOLL_CTL_DEL on each file descriptor instead. ๐Ÿ—‘๏ธ
  • --epollmany-fds โ€” specify the number of file descriptors to be created via epoll_create1(2). Default is 512, with a range of 1 to 1000000. ๐ŸŒˆ
  • --epollmany-ops N โ€” stop after N epoll_create1(2) operations.

๐Ÿ“ก Ethernet packet sniffer

  • --eth-sniff N โ€” starts N stressors that sniff ethernet packets. The --metrics option will show the data count in kilobytes of commonly used IPv4 and IPv6 protocols. Linux only and requires the CAP_NET_RAW capability โ€” so like, bring the right permissions or it's not happening. ๐Ÿซถ
  • --eth-sniff-ops N โ€” stop after N bogo ethernet packet sniffs.

๐ŸŽ€ Event file descriptor (eventfd) stressor

  • --eventfd N โ€” starts N parent and child worker processes that read and write 8 byte event messages between them via the eventfd mechanism (Linux only). ๐Ÿ’Œ
  • --eventfd-nonblock โ€” enables EFD_NONBLOCK to allow non-blocking on the event file descriptor. This will cause reads and writes to return with EAGAIN rather than blocking, and hence causes a high rate of polling I/O. Busy little bee energy. ๐Ÿ
  • --eventfd-ops N โ€” stop eventfd workers after N bogo operations.

๐Ÿงš Exec processes stressor

  • --exec N โ€” starts N workers continually forking children that exec stress-ng and then exit almost immediately. If a system has pthread support, then 1 in 4 of the exec's will be from inside a pthread, to exercise exec'ing from inside a pthread context. ๐Ÿ‘‘
  • --exec-fork-method [ clone | fork | rfork | spawn | vfork ] โ€” selects the process creation method using clone(2), fork(2), BSD rfork(2), posix_spawn(3) or vfork(2). Heads up bestie: note that vfork will only exec programs using execve due to the constraints on the shared stack between the parent and the child process. โš ๏ธ
  • --exec-max P โ€” creates P child processes that exec stress-ng and then waits for them to exit per iteration. The default is 4096; higher values may create many temporary zombie processes that are waiting to be reaped. One can potentially fill up the process table using high values for --exec-max and --exec. Zombie apocalypse fr fr ๐Ÿ’€
  • --exec-method [ all | execve | execveat | fexecve ] โ€” selects the exec system call to use. all will perform a random choice between execve(2), execveat(2) and fexecve(3); execve will use execve(2), execveat will use execveat(2) (if available) and fexecve will use fexecve(3) (if available). โœจ
  • --exec-no-pthread โ€” do not use pthread_create(3). Simple as that. ๐Ÿ™…โ€โ™€๏ธ
  • --exec-ops N โ€” stop exec stress workers after N bogo operations.

๐Ÿ’€ Exiting pthread groups stressor

  • --exit-group N โ€” starts N workers that create 16 pthreads and terminate the pthreads and the controlling child process using exit_group(2). (Linux only stressor.) Dramatic exit, honestly iconic. ๐Ÿšช
  • --exit-group-ops N โ€” stop after N iterations of pthread creation and deletion loops.

๐Ÿ“ˆ Exponential functions

  • --expmath N โ€” starts N workers that exercise various exponential functions with input values 0 to 1 in steps of 0.001; the results are sanity checked to ensure no variation occurs after each round of 10000 computations. Math girlies rise ๐Ÿงฎโœจ
  • --expmath-ops N โ€” stop after N exponential bogo-operation loops.
  • --expmath-method method โ€” specify an exponential function to exercise. The available exponential stress methods are described as follows:
    • all โ€” iterate over all the below exponential functions methods
    • cexp โ€” double complex natural exponential
    • cexpf โ€” float complex natural exponential
    • cexpl โ€” long double complex natural exponential
    • exp โ€” double natural exponential
    • expf โ€” float natural exponential
    • expl โ€” long double natural exponential
    • exp10 โ€” double base-10 exponential
    • exp10f โ€” float base-10 exponential
    • exp10l โ€” long double base-10 exponential
    • exp2 โ€” double base-2 exponential
    • exp2f โ€” float base-2 exponential
    • exp2l โ€” long double base-2 exponential

๐Ÿ”ข Factorization of large integers stressor

  • --factor N โ€” starts N workers that factorize large integers using the GNU Multiple Precision Arithmetic Library. Randomized values to be factorized are computed so that an N digit value is comprised of about 0.4 ร— N random factors, for N > 100. The default number of digits in the value to be factorized is 10. Big number brain ๐Ÿง โœจ
  • --factor-digits N โ€” selects the number of digits in the values to be factorized. Range 8 to 100000000 digits, default is 10.
  • --factor-ops N โ€” stop after N factorizations.

๐Ÿ—‚๏ธ File space allocation (fallocate) stressor

  • -F N, --fallocate N โ€” starts N workers continually fallocating (preallocating file space) and ftruncating (file truncating) temporary files. If the file is larger than the free space, fallocate will produce an ENOSPC error which is ignored by this stressor. ๐Ÿ™ˆ
  • --fallocate-bytes N โ€” allocated file size, the default is 1 GB. One can specify the size as % of free space on the file system or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g. ๐Ÿ’พ
  • --fallocate-ops N โ€” stop fallocate stress workers after N bogo fallocate operations.

๐Ÿ‘€ Filesystem notification (fanotify) stressor

  • --fanotify N โ€” starts N workers performing file system activities such as creating, opening, writing, reading and unlinking files to exercise the fanotify event monitoring interface (Linux only). Each stressor runs a child process to generate file events and a parent process to read file events using fanotify. Has to be run with the CAP_SYS_ADMIN capability โ€” no cap, no vibes. ๐ŸŽซ
  • --fanotify-ops N โ€” stop fanotify stress workers after N bogo fanotify events.

๐ŸŒณ CPU branching instruction cache stressor

  • --far-branch N โ€” starts N workers that exercise calls to tens of thousands of functions that are relatively far from the caller. All functions are 1 op instructions that return to the caller. The functions are placed in pages that are memory mapped with a wide spread of fixed virtual addresses. Function calls are pre-shuffled to create a randomized mix of addresses to call. This stresses the instruction cache and any instruction TLBs. Cache chaos, slay. ๐Ÿ”ฅ
  • --far-branch-flush โ€” attempt to periodically flush instruction cache to produce instruction cache misses.
  • --far-branch-ops N โ€” stop after N far branch bogo-ops. One full cycle of calling all the tens of thousands of functions equates to one bogo-op. ๐ŸŒ€
  • --far-branch-pageout โ€” where possible pageout and soft-offline randomly selected pages that contain the far branch functions. This uses madvise(2) MADV_PAGEOUT and MADV_SOFT_OFFLINE to perform these actions. โœจ
  • --far-branch-pages N โ€” specify the number of pages to allocate for far branch functions. The number of functions per page depends on the processor architecture โ€” for example, x86 will have 4096 ร— 1 byte return instructions per 4 K page, whereas SPARC64 will have only 512 ร— 8 byte return instructions per 4 K page. ๐Ÿ–ฅ๏ธ

๐Ÿฉน Page fault stressor

  • --fault N โ€” starts N workers that generate minor and major page faults.
  • --fault-ops N โ€” stop the page fault workers after N bogo page fault operations.

๐Ÿ”’ Fcntl stressor

  • --fcntl N โ€” starts N workers that perform fcntl(2) calls with various commands. The exercised commands (if available) are: F_CREATED_QUERY, F_DUPFD, F_DUPFD_CLOEXEC, F_GETFD, F_SETFD, F_GETFL, F_SETFL, F_GETOWN, F_SETOWN, F_GETOWN_EX, F_SETOWN_EX, F_GETSIG, F_SETSIG, F_GETOWNER_UIDS, F_GETLEASE, F_GETLK, F_SETLK, F_SETLKW, F_UNLCK, F_OFD_GETLK, F_OFD_SETLK, F_OFD_SETLKW, F_GET_FILE_RW_HINT, F_SET_FILE_RW_HINT, F_GET_RW_HINT and F_SET_RW_HINT. That's the whole guest list, bestie ๐Ÿ’Œ
  • --fcntl-ops N โ€” stop the fcntl workers after N bogo fcntl operations.

๐Ÿ’… File descriptor abusing stressor

  • --fd-abuse N โ€” start N workers that open file descriptors using various ways (file, dup, socket, pipe, timerfd, pidfd, userfaultfd, etc.) and perform valid and invalid file operations on these descriptors. This exercises a mix of successful and failed file operations on a wide range of file descriptor types. Itโ€™s giving chaotic little gremlin energy for your kernel ๐Ÿฆ‹
  • --fd-abuse-ops N โ€” stop after N file abuse file operation bogo-ops. periodt ๐Ÿ’…

๐Ÿงš File descriptor duplication and closing stressor

  • --fd-fork N โ€” start N workers that open files using dup(2) on a file (/dev/zero by default) and then copies these using multiple fork'd child processes and closes them with the fast clone_range(2) or close(2) or by directly ending the processes using _exit(2). For every bogo-op, the stressor attempts to dup(2) another 10000 file descriptors up to the maximum allowed, fork 8 child processes that then close their copies of the file descriptors. That is genuinely so many fds bestie ๐Ÿ˜ญ
  • --fd-fork-fds N โ€” specify maximum number of file descriptors to be opened. The default is 2 million, with a range of 1000 to 16 million. The actual number used may be less depending on the system defined limits of the number of open files per process. Yes, the vibes are limited by the system, not by ambition ๐Ÿ‘‘
  • --fd-fork-file [ null | random | stdin | stdout | zero ] โ€” specify file to dup: null for /dev/null, random for /dev/random, stdin for standard input, stdout for standard output, zero for /dev/zero. The default is /dev/zero. ๐Ÿ“
  • --fd-fork-ops N โ€” stop after N rounds of 10000 dups, forking/closing/exiting and waiting for the child processes. Note that the bogo-ops metric rate will slow down over time as this stressor increases the number of open files per bogo-loop and this increases the fork and close run times. So donโ€™t @ me about the rate dropping, itโ€™s literally the stressor doing its thing ๐Ÿ’€

๐ŸŒˆ File descriptor race stressor

  • --fd-race N โ€” start N workers that attempt to force race conditions on opened file descriptors. Opened file descriptors are passed from a server to a client over a socket. At periodic intervals batches of the file descriptors are duplicated by creating multiple pthreads and then closed en-masse with synchronized pthread termination. Also other concurrent pthreads exercise various file based system calls on file descriptors that are in the process of being created. By default a single file is used for the open calls, however /dev and /proc files can be exercised using the appropriate fd-race options. Race condition speedrun any% ๐Ÿ˜ญ
  • --fd-race-dev โ€” exercise /dev files for race conditions. ๐ŸŒ€
  • --fd-race-race-ops N โ€” stop after N file descriptors have been exercised. โญ
  • --fd-race-proc โ€” exercise /proc files for race conditions. ๐Ÿซถ

๐Ÿงš Fibonacci search stressor

  • --fibsearch N โ€” start N workers that use a search a sorted array of 32 bit integers using a Fibonacci search. A Fibonacci search is similar to a bsearch except that it uses the Fibonacci series to divide the search into unequal sized spaces. It avoids the costly division operator found in bsearches and examines closer elements on each search step so there is a slight compute and cache advantage over bsearch. By default, there are 65536 elements in the array. This is a useful method to exercise random access of memory and processor cache. Obsessed with a search algorithm that ate and left no crumbs ๐Ÿ”ฅ
  • --fibsearch-ops N โ€” stop the fibsearch worker after N bogo fibsearch operations are completed. โญ
  • --fibsearch-size N โ€” specify the size (number of 32 bit integers) in the array to fibsearch. Size can be from 1 K to 4 M. ๐ŸŽ€

๐Ÿฆ‹ File extent (fiemap) stressor

  • --fiemap N โ€” start N workers that each create a file with many randomly changing extents and has 4 child processes per worker that gather the extent information using the FS_IOC_FIEMAP ioctl(2). Extent chaos, but make it organized ๐Ÿงš
  • --fiemap-bytes N โ€” specify the size of the fiemap'd file in bytes. One can specify the size as % of free space on the file system or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g. Larger files will contain more extents, causing more stress when gathering extent information. Bigger file = more extents = more stress, no cap ๐Ÿ’–
  • --fiemap-ops N โ€” stop after N fiemap bogo operations. โœจ

๐ŸŒธ FIFO named pipe stressor

  • --fifo N โ€” start N workers that exercise a named pipe by transmitting 64 bit integers. ๐ŸŽ€
  • --fifo-data-size N โ€” set the byte size of the fifo write/reads, default is 8, range 8..4096. ๐Ÿ“
  • --fifo-ops N โ€” stop fifo workers after N bogo pipe write operations. โญ
  • --fifo-readers N โ€” for each worker, create N fifo reader workers that read the named pipe using simple blocking reads. The default is 4, range 1..64. ๐Ÿ’œ

๐Ÿ’… File I/O control (ioctl) stressor

  • --file-ioctl N โ€” start N workers that exercise various file specific ioctl(2) calls. This will attempt to use the FIONBIO, FIOQSIZE, FIGETBSZ, FIOCLEX, FIONCLEX, FIONBIO, FIOASYNC, FIOQSIZE, FIFREEZE, FITHAW, FICLONE, FICLONERANGE, FIONREAD, FIONWRITE and FS_IOC_RESVSP ioctls if these are defined. The duplicate-looking names are exactly the list, bestie, donโ€™t come for me ๐Ÿ”ฅ
  • --file-ioctl-ops N โ€” stop file-ioctl workers after N file ioctl bogo operations. ๐Ÿ˜ญ

๐Ÿงš File hole and file extents stressor

  • --filehole N โ€” start N workers that write data, create file holes and zero fill a 16 MB file. Where available, this uses fallocate(2) FALLOC_FL_PUNCH_HOLE and FALLOC_FL_ZERO_RANGE as well as data writing to create holes and also write zero and write random data to the file. The data and holes are placed in the file in reverse order, then in random order then forward order to try and create multiple file extents. Every 1024 writes the data is fsync'd for periodic forced data flushing. Holes and data sizes are based on the page size. File holes are lowkey main character energy ๐ŸŒ€
  • --filehole-bytes N โ€” set maximum size of each file for each filehole worker process, the default is 16 MB. One can specify the size as % of free space on the file system or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g. ๐ŸŽ€
  • --filehole-defrag โ€” perform a naรฏve file defragment by copying a new version of the file to remove multiple extents and use the copy. ๐Ÿ’–
  • --filehole-ops N โ€” stop filehole workers after N rounds of bogo write/fallocate operations. ๐Ÿ’…

๐ŸŒˆ Filename stressor

  • --filename N โ€” start N workers that exercise file creation using various length filenames containing a range of allowed filename characters. This will try to see if it can exceed the file system allowed filename length, plus it tests various filename lengths between 1 and the maximum allowed by the file system. Filename length vibe check, but make it filesystem law ๐Ÿ˜ญ
  • --filename-ops N โ€” stop filename workers after N bogo filename tests. โญ
  • --filename-opts opt โ€” use characters in the filename based on option opt. Valid options are: ๐Ÿ’…
    • probe โ€” default option, probe the file system for valid allowed characters in a file name and use these.
    • posix โ€” use characters as specified by The Open Group Base Specifications Issue 7, POSIX.1-2008, 3.278 Portable Filename Character Set.
    • ext โ€” use characters allowed by the ext2, ext3, ext4 file systems, namely any 8 bit character apart from NUL and /.
    • utf8 โ€” use strict utf8 characters in filename.
    • urf8-like โ€” use utf8 like characters with illegal utf8 encodings when generating random filenames. And yes, urf8-like is literally spelled like that here ๐Ÿ‘€

๐Ÿฆ‹ File race stressor

  • --filerace N โ€” start N workers that each run 8 concurrent processes that exercise a randomized set of file related system calls on random files. This attempts to trip any file system race conditions while files are being operated upon. The randomized operations will cause some invalid file operations to fail, these failures are silently ignored. Silently ignored failures are so real ๐Ÿ’€
  • --filerace-files N โ€” specify the maximum number of random files to exercise; range 1..256 with a default of 64. ๐Ÿ“
  • --filerace-procs N โ€” specify the number of child processes per worker to spawn to exercise the file racing. Note that the main stressor process plus the child processes makes up the total number of concurrent processes running per stressor instance. The range is 1 to 64, with a default of 7. ๐Ÿซถ
  • --filerace-ops N โ€” stop after N randomized file bogo-operations, this is not a reliable metric of performance because of the highly randomized actions occurring on randomly selected files. Do not use this number as your flex, it is not that kind of number ๐Ÿ’…

๐Ÿ‘‘ Single cacheline coherency scalability stressor

  • --flipflop N โ€” start N workers where each worker creates two groups of threads of the same size where each group is affined to a set of CPUs. A continuous bitmap that has enough bits for each thread pair is exercised, each thread pair tries to flip/flop their specific bit using cmpxchg (compare/exchange); one thread tries to flip the bit from 0 to 1 and the other tries to flop the bit from 1 to 0. This stressor makes threads compete on the same cacheline and measures the total number of flip/flop operations and the distribution of successful flip/flops among the threads (to see if thread pairs get starved in favour of others). Cacheline drama, measured and distributed ๐Ÿ”ฅ
  • --flipflop-bits N โ€” specifies number of bits in the bitmap (and hence number of flip/flop thread pairs). ๐Ÿ’œ
  • --flipflop-taskset1 list โ€” the list of CPUs to affine the flip threads to ๐Ÿ’…. Wanna know the syntax for list? Go peek at the --taskset option description, it's all there bestie.
  • --flipflop-taskset2 list โ€” same deal but for the flop threads โ€” CPUs to affine them to ๐Ÿฆ‹. Again, syntax lives in the --taskset description.
  • --flipflop-ops N โ€” stop after N bogo-ops. Warning: in this context a bogo-op is literally 100000 flip-flop operations, so likeโ€ฆ pace yourself ๐Ÿ˜ญ.

๐Ÿงš BSD File locking (flock) stressor

  • --flock N โ€” start N workers that lock on a single file ๐Ÿ”’.
  • --flock-ops N โ€” stop the flock stress workers after N bogo flock operations.

๐ŸŒธ Cache flushing stressor

  • --flushcache N โ€” start N workers that flush the data and instruction cache (where possible โœจ). Heads up: some architectures may not support cache flushing on either cache, and in that case these become literal no-ops ๐Ÿ’€.
  • --flushcache-d-bytes N โ€” set the size of the data region to be data-flushed. Range is 1K to 4GB, default is the lower level data cache size. You can give the size as a % of total available memory, or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g ๐ŸŽ€.
  • --flushcache-i-bytes N โ€” set the size of the instruction region to be instruction-flushed. Range 1K to 4GB, default is the level 1 instruction cache size. Same deal: % of total available memory, or Bytes/KBytes/MBytes/GBytes via the suffix b, k, m or g ๐Ÿซถ.
  • --flushcache-ops N โ€” stop after N cache flush iterations.

๐Ÿ”ฅ Fused Multiply/Add floating point operations (fma) stressor

  • --fma N โ€” start N workers that exercise single and double precision floating point multiplication and add operations on arrays of 512 floating point values. On more modern processors (Intel Haswell, AMD Bulldozer and Piledriver) and with modern C compilers, these operations get performed by fused-multiply-add (fma3) opcodes ๐Ÿ‘‘. The operations used are:
a = (a ร— b) + c
a = (b ร— a) + c
a = (b ร— c) + a
a = (a ร— b) โˆ’ c
a = (b ร— a) โˆ’ c
a = (b ร— c) โˆ’ a
  • --fma-libc โ€” use libc fma math functions if they're available ๐Ÿ’…. These use either the libc FMA macros if defined, the __builtin libc functions, or the fma libc functions. Generally these are slower than directly multiply/add fused code generated by the compiler, ngl.
  • --fma-ops N โ€” stop after N bogo-loops of the 3 above operations on 512 single and double precision floating point numbers.

๐Ÿ“ Process forking stressor

  • -f N, --fork N โ€” start N workers continually forking children that immediately exit ๐Ÿ˜ญ.
  • --fork-max P โ€” create P child processes and then wait for them to exit per iteration. Default is just 1; higher values will create many temporary zombie processes that are waiting to be reaped ๐Ÿ’€. Fr fr you can potentially fill up the process table using high values for --fork-max and --fork.
  • --fork-ops N โ€” stop the fork stress workers after N bogo operations.
  • --fork-pageout โ€” enable forced paging-out of memory resident pages in fork stressor instances ๐Ÿฆ‹.
  • --fork-unmap โ€” attempt to unmap unused non-memory resident shared library pages to attempt to reduce anonymous vma copying. This is an ugly hack for benchmarking reduced vma copying and it's not guaranteed to work ๐Ÿ™ˆ. Linux only.
  • --fork-vm โ€” enable detrimental-performance virtual memory advice using madvise(2) on all pages of the forked process. Where possible this tries to set every page in the new process using madvise(2) with the MADV_MERGEABLE, MADV_WILLNEED, MADV_HUGEPAGE and MADV_RANDOM flags ๐Ÿ”ฅ. Linux only.

๐Ÿ’œ Heavy process forking stressor

  • --forkheavy N โ€” start N workers that fork child processes from a parent that has thousands of allocated system resources. The fork becomes a heavyweight operation because it has to duplicate the resource references of the parent ๐Ÿ‘‘. Each stressor instance creates and reaps up to 4096 child processes, created and reaped in a first-in first-out manner.
  • --forkheavy-allocs N โ€” attempt N resource allocation loops per stressor instance. Resources include pipes, file descriptors, memory mappings, pthreads, timers, ptys, semaphores, message queues and temporary files ๐ŸŽ€. These create heavyweight processes that are more time expensive to fork from. The default is 16384.
  • --forkheavy-mlock โ€” attempt to mlock(2) future allocated pages into memory, causing more memory pressure ๐Ÿ’…. If mlock(MCL_FUTURE) is implemented then this stops new brk pages from being swapped out.
  • --forkheavy-ops N โ€” stop after N fork calls.
  • --forkheavy-procs N โ€” attempt to fork N processes per stressor. The default is 4096 processes.

โญ Floating point operations stressor

  • --fp N โ€” start N workers that exercise addition, multiplication and division operations on a range of floating point types ๐ŸŒˆ. For each type, 8 floating point values are operated upon 65536 times in a loop per bogo op.
  • --fp-method method โ€” pick the floating point method to use, bestie. Available methods are:
    • all โ€” iterate over all the following floating point methods:
    • float128add โ€” 128 bit floating point addition
    • ibm128add โ€” IBM 128 bit floating point addition (powerpc)
    • float80add โ€” 80 bit floating point addition
    • float64add โ€” 64 bit floating point addition
    • float32add โ€” 32 bit binary32 floating point addition
    • floatadd โ€” floating point addition
    • bf16add โ€” bf16 floating point addition
    • doubleadd โ€” double precision floating point addition
    • ldoubleadd โ€” long double precision floating point addition
    • float128sub โ€” 128 bit floating point subtraction
    • ibm128sub โ€” IBM 128 bit floating point subtraction (powerpc)
    • float80sub โ€” 80 bit floating point subtraction
    • float64sub โ€” 64 bit floating point subtraction
    • float32sub โ€” 32 bit binary32 floating point subtraction
    • floatsub โ€” floating point subtraction
    • bf16sub โ€” bf16 floating point subtraction
    • doublesub โ€” double precision floating point subtraction
    • ldoublesub โ€” long double precision floating point subtraction
    • float128mul โ€” 128 bit floating point multiplication
    • ibm128mul โ€” IBM 128 bit floating point multiplication (powerpc)
    • float80mul โ€” 80 bit floating point multiplication
    • float64mul โ€” 64 bit floating point multiplication
    • float32mul โ€” 32 bit binary32 floating point multiplication
    • floatmul โ€” floating point multiplication
    • bf16mul โ€” bf16 floating point multiplication
    • doublemul โ€” double precision floating point multiplication
    • ldoublemul โ€” long double precision floating point multiplication
    • float128div โ€” 128 bit floating point division
    • ibm128div โ€” IBM 128 bit floating point division (powerpc)
    • float80div โ€” 80 bit floating point division
    • float64div โ€” 64 bit floating point division
    • float32div โ€” 32 bit binary32 floating point division
    • floatdiv โ€” floating point division
    • bf16div โ€” bf16 floating point division
    • doublediv โ€” double precision floating point division
    • ldoublediv โ€” long double precision floating point division
Heads up babes: some of these floating point methods may not be available on some systems ๐Ÿ™ˆ.
  • --fp-ops N โ€” stop after N floating point bogo ops. Note that bogo-ops are counted for just standard float, double and long double floating point types ๐Ÿ’–.

๐Ÿ’€ Floating point exception stressor

  • --fp-error N โ€” start N workers that generate floating point exceptions. Computations are performed to force and check for the FE_DIVBYZERO, FE_INEXACT, FE_INVALID, FE_OVERFLOW and FE_UNDERFLOW exceptions ๐Ÿ”ฅ. EDOM and ERANGE errors are also checked.
  • --fp-error-ops N โ€” stop after N bogo floating point exceptions.

๐ŸŽ€ Miscellaneous floating point math macro operations

๐Ÿฆ‹ Subnormal floating point operations stressor

  • --fp-subnormal N โ€” start N workers that exercise addition, multiplication and division operations on a range of floating point types using subnormal floating point values ๐Ÿ‘‘. For each type, floating point values are operated upon 65536 times in a loop per bogo op. Subnormal floating point values are values where the mantissa does not have a leading binary digit 1, and handling them may require a software assist, causing a performance impact ๐Ÿ’€. Performance may also vary between C implementations because of strategies such as rounding subnormals to zero.
  • --fp-subnormal-method method โ€” pick the floating point method to use, bestie. Available methods are:
  • all โ€” literally just iterate over every single one of the floating point methods below, no picking favourites ๐Ÿ’…
  • floatadd โ€” floating point addition
  • doubleadd โ€” double precision floating point addition
  • ldoubleadd โ€” long double precision floating point addition
  • floatsub โ€” floating point subtraction
  • doublesub โ€” double precision floating point subtraction
  • ldoublesub โ€” long double precision floating point subtraction
  • floatmul โ€” floating point multiplication
  • doublemul โ€” double precision floating point multiplication
  • ldoublemul โ€” long double precision floating point multiplication
  • floatdiv โ€” floating point division
  • doublediv โ€” double precision floating point division
  • ldoublediv โ€” long double precision floating point division
  • --fp-subnormal-ops N โ€” stop after N floating point subnormal bogo ops. that's it, that's the whole vibe ๐Ÿซถ

๐Ÿ•ณ๏ธ File punch and hole filling stressor โœจ

  • --fpunch N โ€” start N workers that punch and fill holes in a 16 MB file using five concurrent processes per stressor all exercising on the same file. Where available, this uses fallocate(2) FALLOC_FL_KEEP_SIZE, FALLOC_FL_PUNCH_HOLE, FALLOC_FL_ZERO_RANGE, FALLOC_FL_COLLAPSE_RANGE and FALLOC_FL_INSERT_RANGE to make and fill holes across the file to break it into multiple extents. it's giving swiss cheese, honestly ๐Ÿง€
  • --fpunch-bytes N โ€” set the maximum size of each file for each fpunch worker process, the default is 16 MB. One can specify the size as % of free space on the file system or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g. pick your units bestie, live ur truth ๐Ÿ’œ
  • --fpunch-ops N โ€” stop fpunch workers after N punch and fill bogo operations.

๐ŸŒ€ Fractal stressor ๐Ÿฆ‹

  • --fractal N โ€” start N workers that generate 2D fractals. By default a 1024 x 1024 point Mandelbrot set is computed with a maximum of 256 iterations per point in the iterative compute loop. The fractal is computed row by row with multiple rows shared amongst the N fractal stressor instances. Double precision floating point values are used for the points in the complex set of values. Naรฏve computation is used with no special algorithmic short-cuts or interpolation. no shortcuts, no glow-ups, just raw number crunching fr fr ๐Ÿ˜ค
  • --fractal-iterations N โ€” specify the maximum number of iterations for the quadratic map computation of each point, default is 256 iterations.
  • --fractal-method [ julia | mandelbrot ] โ€” select the method of fractal generation, Julia set or Mandelbrot set, default is the Mandelbrot set. both iconic, pick your queen ๐Ÿ‘‘
  • --fractal-ops N โ€” stop after N fractals have been generated.
  • --fractal-sizex N โ€” set the maximum width of the fractal, default is 1024 points.
  • --fractal-sizey N โ€” set the maximum height of the fractal, default is 1024 points.

๐Ÿ“ File size limit stressor ๐Ÿ’€

  • --fsize N โ€” start N workers that exercise file size limits (via setrlimit(2) RLIMIT_FSIZE) with file sizes that are fixed, random and powers of 2. The files are truncated and allocated to trigger SIGXFSZ signals. yes bestie we are deliberately triggering signals, that's the whole point ๐Ÿ™ˆ
  • --fsize-ops N โ€” stop after N bogo file size test iterations.

๐Ÿ” File stats (fstat) stressor ๐ŸŒธ

  • --fstat N โ€” start N workers fstat'ing files in a directory (default is /dev). lowkey obsessed with that directory ngl
  • --fstat-dir directory โ€” specify the directory to fstat to override the default of /dev. All the files in the directory will be fstat'd repeatedly. every single one. repeatedly. you've been warned ๐Ÿ’…
  • --fstat-ops N โ€” stop fstat stress workers after N bogo fstat operations.

๐Ÿˆ /dev/full stressor ๐Ÿ˜ญ

  • --full N โ€” start N workers that exercise /dev/full. This attempts to write to the device (which should always produce the error ENOSPC), to read from the device (which should always return a buffer of zeros) and to seek randomly on the device (which should always succeed). (Linux only). it's the device that's always full and honestly same ๐Ÿ“
  • --full-ops N โ€” stop the stress full workers after N bogo I/O operations.

๐Ÿ“ž Function argument passing stressor ๐Ÿซถ

  • --funccall N โ€” start N workers that call functions of 1 through to 9 arguments. By default all functions with a range of argument types are called, however, this can be changed using the --funccall-method option. This exercises stack function argument passing and re-ordering on the stack and in registers. pushing args around like it's a group chat with too many tabs open ๐Ÿ’€
  • --funccall-ops N โ€” stop the funccall workers after N bogo function call operations. Each bogo operation is 1000 calls of functions of 1 through to 9 arguments of the chosen argument type.
  • --funccall-method method โ€” specify the method of funccall argument type to be used. The default is all the types but can be one of bool, uint8, uint16, uint32, uint64, uint128, float, double, longdouble, cfloat (complex float), cdouble (complex double), clongdouble (complex long double), float16, float32, float64, float80, float128, decimal32, decimal64 and decimal128. Note that some of these types are only available with specific architectures and compiler versions. so if ur fave type ghosts you, that's an architecture thing, not a you thing ๐Ÿงš

๐Ÿ” Function return stressor ๐ŸŽ€

  • --funcret N โ€” start N workers that pass and return by value various small to large data types. return it back, bestie, we're doing by-value round trips โœจ
  • --funcret-ops N โ€” stop the funcret workers after N bogo function call operations.
  • --funcret-method method โ€” specify the method of funcret argument type to be used. The default is 'all' but can be one of uint8 uint16 uint32 uint64 uint128 float double longdouble float80 float128 decimal32 decimal64 decimal128 uint8x32 uint8x128 uint64x128 cfloat cdouble clongdouble. that's a whole menu, order whatever ๐Ÿ’…

๐Ÿ”’ Fast mutex (futex) stressor ๐Ÿ”ฅ

  • --futex N โ€” start N workers that rapidly exercise the futex system call. Each worker has two processes, a futex waiter and a futex waker. The waiter waits with a very small timeout to stress the timeout and rapid polled futex waiting. This is a Linux specific stress option. one waiter, one waker, chaotic duo energy ๐Ÿ‘ฏ
  • --futex-ops N โ€” stop futex workers after N bogo successful futex wait operations.

๐Ÿงฎ Gamma functions stressor โญ

  • --gamma N โ€” start N workers that exercise tgamma and lgamma libm gamma functions using float, double and long double floating point variants. Each function is exercised 10000 times per bogo-operation. The Gamma function is the integral from 0 to โˆž of tโ†‘(x โˆ’ 1) eโ†‘-t dt. math girlies rise ๐ŸŒˆ
  • --gamma-method function โ€” specify a gamma stress function. By default, all the functions are exercised sequentially, however one can specify just one function to be used if required. Available options are as follows:
  • all โ€” iterate through all of the following gamma functions
  • lgamma โ€” natural logarithm of the absolute value of the Gamma function (double)
  • lgammaf โ€” natural logarithm of the absolute value of the Gamma function (float)
  • lgammal โ€” natural logarithm of the absolute value of the Gamma function (long double)
  • tgamma โ€” Gamma function (double)
  • tgammaf โ€” Gamma function (float)
  • tgammal โ€” Gamma function (long double)
  • --gamma-ops N โ€” stop after N bogo-operations.

๐Ÿ“ฅ Fetching data from kernel stressor ๐Ÿ‘‘

๐Ÿ“‚ Get directory entries stressor (Linux) ๐Ÿ“

  • --getdent N โ€” start N workers that recursively read directories /proc, /dev/, /tmp, /sys and /run using getdents(2) and getdents64(2) (Linux only). recursively reading everything, nosy in the best way ๐Ÿ™ˆ
  • --getdent-ops N โ€” stop getdent workers after N bogo getdent bogo operations.

๐ŸŽฒ Random data (getrandom) stressor ๐ŸŒŸ

  • --getrandom N โ€” start N workers that get 8192 random bytes from the /dev/urandom pool using the getrandom(2) system call (Linux) or getentropy(2) (OpenBSD). 8192 whole random bytes, look at them go ๐Ÿ’–
  • --getrandom-ops N โ€” stop getrandom workers after N bogo get operations.

๐Ÿšฆ CPU pipeline and branch prediction stressor ๐Ÿ”€

  • --goto N โ€” start N workers that perform 2048 forward branches (to next instruction) or backward branches (to previous instruction) for each bogo operation loop. By default, every 2048 branches the direction is randomly chosen to be forward or backward. This stressor exercises suboptimal pipelined execution and branch prediction logic. we are bullying the branch predictor, respectfully ๐Ÿ’€
  • --goto-direction [ forward | backward | random ] โ€” select the branching direction in the stressor loop, forward for forward only branching, backward for backward only branching, random for a random choice of forward or random branching every 2048 branches. pick a lane bestie ๐Ÿซถ
  • --goto-ops N โ€” stop goto workers after N bogo loops of 2048 branch instructions.

๐ŸŽฎ GPU opengl stressor โœจ

  • --gpu N โ€” spins up N workers that go exercise the GPU. Basically it sets up a 2-D texture image (so shaders can read the elements of an image array) and then renders primitives using an opengl context ๐Ÿ’…
  • --gpu-devnode DEVNAME โ€” tells it which device node name to use for the GPU device. The default is /dev/dri/renderD128.
  • --gpu-frag N โ€” sets shader core usage per pixel, i.e. it plants N loops inside the fragment shader. More loops, more pain ๐Ÿ”ฅ
  • --gpu-ops N โ€” the gpu workers dip out after N render loop operations.
  • --gpu-tex-size N โ€” upload texture is N ร— N, and by default that value is 4096 ร— 4096.
  • --gpu-xsize X โ€” framebuffer size of X pixels. Default is 256 pixels.
  • --gpu-ysize Y โ€” framebuffer size of Y pixels. Default is 256 pixels.
  • --gpu-upload N โ€” upload the texture N times per frame, default value is 1.

๐Ÿซถ Handle stressor ๐ŸŽ€

  • --handle N โ€” starts N workers that exercise the name_to_handle_at(2) and open_by_handle_at(2) system calls. (Linux only, bestie ๐Ÿ’€)
  • --handle-ops N โ€” stop after N handle bogo operations.

๐ŸŒธ String hashing stressor ๐Ÿฆ‹

  • --hash N โ€” starts N workers that exercise a whole bunch of hashing functions. Random strings from 1 to 128 bytes get hashed, and then the hashing rate plus chi squared is calculated from how many hashes happened over a period of time. The chi squared value is the goodness-of-fit measure โ€” it's the actual distribution of items in hash buckets versus the expected distribution of items. Typically a chi squared value close to 1.0 means a good hash distribution ๐Ÿ‘‘
  • --hash-method method โ€” picks the hashing method to use. By default all the hashing methods get cycled through. The methods available are:
    • all โ€” cycle through all the hashing methods
    • adler32 โ€” Mark Adler checksum, a modification of the Fletcher checksum
    • coffin โ€” xor and 5 bit rotate left hash
    • coffin32 โ€” xor and 5 bit rotate left hash with 32 bit fetch optimization
    • crc32c โ€” compute CRC32C (Castagnoli CRC32) integer hash
    • djb2a โ€” Dan Bernstein hash using the xor variant
    • fnv1a โ€” FNV-1a Fowler-Noll-Vo hash using the xor then multiply variant
    • jenkin โ€” Jenkin's integer hash
    • kandr โ€” Kernighan and Richie's multiply by 31 and add hash from "The C Programming Language", 2nd Edition
    • knuth โ€” Donald E. Knuth's hash from "The Art Of Computer Programming", Volume 3, chapter 6.4
    • loselose โ€” Kernighan and Richie's simple hash from "The C Programming Language", 1st Edition
    • mid5 โ€” xor shift hash of the middle 5 characters of the string. Designed by Colin Ian King
    • muladd32 โ€” simple multiply and add hash using 32 bit math and xor folding of overflow
    • muladd64 โ€” simple multiply and add hash using 64 bit math and xor folding of overflow
    • mulxror32 โ€” 32 bit multiply, xor and rotate right. Mangles 32 bits where possible. Designed by Colin Ian King
    • mulxror64 โ€” 64 bit multiply, xor and rotate right. 64 Bit version of mulxror32
    • murmur3_32 โ€” Austin Appleby's Murmur3 hash, 32 bit variant
    • nhash โ€” exim's nhash.
    • pjw โ€” a non-cryptographic hash function created by Peter J. Weinberger of AT&T Bell Labs, used in UNIX ELF object files
    • sdbm โ€” sdbm hash as used in the SDBM database and GNU awk
    • sedgwick โ€” simple hash from Robert Sedgwick's C programming book
    • sobel โ€” Justin Sobel's bitwise shift hash
    • x17 โ€” multiply by 17 and add. The multiplication can be optimized down to a fast right shift by 4 and add on some architectures
    • xor โ€” simple rotate shift and xor of values
    • xorror32 โ€” 32 bit exclusive-or with right rotate hash, a fast string hash, designed by Colin Ian King
    • xorror64 โ€” 64 bit version of xorror32
    • xxhash โ€” the "Extremely fast" hash in non-streaming mode
  • --hash-ops N โ€” stop after N hashing rounds.

๐Ÿ“ File-system stressor ๐Ÿ’œ

  • -d N, --hdd N โ€” starts N workers that are constantly writing, reading and removing temporary files. Default mode is to stress test sequential writes and reads. With the --aggressive option enabled and no --hdd-opts options given, the hdd stressor will work through all the --hdd-opt options one by one so it covers a whole range of I/O options. Iconic behaviour honestly.
  • --hdd-bytes N โ€” write N bytes for each hdd process, default is 1 GB. You can also give the size as % of free space on the file system, or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g.
  • --hdd-opts list โ€” specify various stress test options as a comma separated list. The options are:
    • direct โ€” try to minimize cache effects of the I/O. File I/O writes are performed directly from user space buffers and synchronous transfer is also attempted. To guarantee synchronous I/O, also use the sync option.
    • dsync โ€” ensure output has been transferred to underlying hardware and file metadata has been updated (using the O_DSYNC open flag). This is equivalent to each write(2) being followed by a call to fdatasync(2). See also the fdatasync option.
    • fadv-dontneed โ€” advise kernel to expect the data will not be accessed in the near future.
    • fadv-noreuse โ€” advise kernel to expect the data to be accessed only once.
    • fadv-normal โ€” advise kernel there is no explicit access pattern for the data. This is the default advice assumption.
    • fadv-rnd โ€” advise kernel to expect random access patterns for the data.
    • fadv-seq โ€” advise kernel to expect sequential access patterns for the data.
    • fadv-willneed โ€” advise kernel to expect the data to be accessed in the near future.
    • fsync โ€” flush all modified in-core data after each write to the output device using an explicit fsync(2) call.
    • fdatasync โ€” similar to fsync, but do not flush the modified metadata unless metadata is required for later data reads to be handled correctly. This uses an explicit fdatasync(2) call.
    • iovec โ€” use readv/writev multiple buffer I/Os rather than read/write. Instead of 1 read/write operation, the buffer is broken into an iovec of 16 buffers.
    • noatime โ€” do not update the file last access timestamp, this can reduce metadata writes.
    • sync โ€” ensure output has been transferred to underlying hardware (using the O_SYNC open flag). This is equivalent to each write(2) being followed by a call to fsync(2). See also the fsync option.
    • rd-rnd โ€” read data randomly.
    • rd-seq โ€” read data sequentially.
    • syncfs โ€” write all buffered modifications of file metadata and data on the filesystem that contains the hdd worker files.
    • utimes โ€” force update of file timestamp which may increase metadata writes.
    • wr-rnd โ€” write data randomly. The wr-seq option cannot be used at the same time.
    • wr-seq โ€” write data sequentially. This is the default if no write modes are specified.
Heads up bestie: some of these options are mutually exclusive. Like, there can be only one method of writing or reading. Also, fadvise flags may be mutually exclusive โ€” for example fadv-willneed cannot be used with fadv-dontneed. Don't try it, it's giving chaos ๐Ÿ˜ญ
  • --hdd-ops N โ€” stop hdd stress workers after N bogo operations.
  • --hdd-sleep N โ€” sleep for N seconds after each round of hdd I/O operations. A value of zero will sleep forever ๐Ÿ‘€ Range 0..3600.
  • --hdd-write-size N โ€” specify size of each write in bytes. Size can be from 1 byte to 4 MB.

๐Ÿงš BSD heapsort stressor โญ

  • --heapsort N โ€” starts N workers that sort 32 bit integers using the BSD heapsort.
  • --heapsort-method [ heapsort-libc | heapsort-nonlibc ] โ€” pick either the libc implementation of heapsort or an optimized implementation of heapsort. The default is the libc implementation if it is available ๐ŸŽ€
  • --heapsort-ops N โ€” stop heapsort stress workers after N bogo heapsorts.
  • --heapsort-size N โ€” specify number of 32 bit integers to sort, default is 262144 (256 ร— 1024).

๐ŸŒธ High resolution timer stressor ๐ŸŒธ

  • --hrtimers N โ€” spin up N workers that go absolutely feral on high resolution timers at a high frequency ๐Ÿ’…. Each stressor literally starts 32 processes running with random timer intervals of 0..499999 nanoseconds. And bestie, if you run this with the appropriate privilege it'll run them with the SCHED_RR policy ๐Ÿ‘‘
  • --hrtimers-adjust โ€” turns on automatic timer rate adjustment to try to maximize the hrtimer frequency โœจ. The signal rate gets measured every 0.1 seconds and the hrtimer delay is adjusted to try and set the optimal hrtimer delay so you generate the highest hrtimer rates. It's giving optimization era ๐ŸŽ€
  • --hrtimers-ops N โ€” stop the hrtimers stressors after N timer event bogo operations ๐Ÿซถ

๐Ÿฆ‹ Hashtable searching (hsearch) stressor ๐Ÿฆ‹

  • --hsearch N โ€” start N workers that search an 80% full hash table using hsearch(3). By default there are 8192 elements inserted into the hash table. Genuinely such a useful method to exercise access of memory and processor cache ๐Ÿ’–
  • --hsearch-method [ hsearch-libc | hsearch-nonlibc ] โ€” pick either the libc implementation of hsearch or a slightly optimized non-libc implementation of hsearch. The default is the libc implementation if it exists, otherwise the non-libc version (iykyk) โœจ
  • --hsearch-ops N โ€” stop the hsearch workers after N bogo hsearch operations are completed โœ…
  • --hsearch-size N โ€” specify the number of hash entries to be inserted into the hash table. Size can be from 1 K to 4 M. No cap on the slay though ๐Ÿ’…

๐ŸŽ€ Huge page merging and splitting stressor ๐ŸŽ€

  • --hugepage N โ€” start N workers that exercise page merging (collapsing) and splitting on huge pages with two concurrent threads of execution (one merging and the other splitting). This exercises contention on huge page allocation paths, page table locking, and TLB shootdowns ๐Ÿ”ฅ. The stressor selects the smallest reasonable huge page size where possible, with a bias towards 2MB huge pages if supported ๐Ÿ‘‘
  • --hugepage-dontneed โ€” use MADV_DONTNEED where possible to try to split huge pages. Heads up: there is an added overhead in zero'ing new pages when the huge pages are merged ๐Ÿ’€
  • --hugepage-method [ forward | random | reverse ] โ€” select the method of selecting the next non-hugepage page to split; forward selects pages working forwards through memory, random selects pages randomly, and reverse selects pages working in reverse through memory. The default is random ๐ŸŒˆ
  • --hugepage-num N โ€” use N huge pages for the allocation. The default is just 2 huge pages per stressor instance ๐Ÿ“
  • --hugepage-ops โ€” stop after N rounds of page merging ๐Ÿฆ‹
  • --hugepage-remove โ€” use MADV_REMOVE where possible to try to split huge pages. Same vibe as above: there is an added overhead in zero'ing new pages when the huge pages are merged ๐Ÿ˜ญ

๐ŸŒˆ Hyperbolic functions stressor ๐ŸŒˆ

  • --hyperbolic N โ€” start N workers that exercise sinh, cosh, and tanh libm hyperbolic functions using float, double and long double floating point variants. Each function is exercised 10000 times per bogo-operation. Math girlies rise ๐Ÿ’…โœจ
  • --hyperbolic-method function โ€” specify a hyperbolic stress function. By default, all the functions are exercised sequentially, however one can specify just one function to be used if required. Available options are as follows:
    • all โ€” iterate through all of the following hyperbolic functions
    • cosh โ€” hyperbolic cosine (double precision)
    • coshf โ€” hyperbolic cosine (float precision)
    • coshl โ€” hyperbolic cosine (long double precision)
    • sinh โ€” hyperbolic sine (double precision)
    • sinhf โ€” hyperbolic sine (float precision)
    • sinhl โ€” hyperbolic sine (long double precision)
    • tanh โ€” hyperbolic tangent (double precision)
    • tanhf โ€” hyperbolic tangent (float precision)
    • tanhl โ€” hyperbolic tangent (long double precision)
  • --hyperbolic-ops N โ€” stop after N bogo-operations ๐Ÿซถ

โญ CPU instruction cache load stressor โญ

  • --icache N โ€” start N workers that stress the instruction cache by forcing instruction cache reloads ๐Ÿ”ฅ
  • --icache-ops N โ€” stop the icache workers after N bogo icache operations are completed โœ…
  • --icache-pages N โ€” specify the number of pages to use for instruction cache stressing for each stressor instance. The default is 1 page, range 1 to 1024 ๐ŸŽ€

๐Ÿ’œ ICMP flooding stressor ๐Ÿ’œ

  • --icmp-flood N โ€” start N workers that flood localhost with randomly sized ICMP ping packets ๐ŸŒŠ. This stressor requires the CAP_NET_RAW capability โ€” no cap, no flooding, periodt ๐Ÿ‘‘
  • --icmp-flood-max-size โ€” use a maximum packet size of 65535 bytes instead of the default of 1000 bytes. Absolute unit energy ๐Ÿ’€
  • --icmp-flood-ops N โ€” stop icmp flood workers after N ICMP ping packets have been sent ๐Ÿ“จ

๐Ÿงš Idle page scan stressor (Linux) ๐Ÿงš

  • --idle-page N โ€” start N workers that walk through every page exercising the Linux /sys/kernel/mm/page_idle/bitmap interface. Requires the CAP_SYS_RESOURCE capability ๐Ÿ”
  • --idle-page-ops N โ€” stop after N bogo idle page operations ๐Ÿฆ‹

๐ŸŒธ Inode ioctl flags stressor ๐ŸŒธ

  • --inode-flags N โ€” start N workers that exercise inode flags using the FS_IOC_GETFLAGS and FS_IOC_SETFLAGS ioctl(2) and inode attributes using file_getattr(2) and file_getatt(2) ๐Ÿ“. This attempts to apply all the available inode flags onto a directory and file even if the underlying file system may not support these flags (errors are just ignored ๐Ÿ™ˆ). Each worker runs 4 threads that exercise the flags on the same directory and file to try to force races. This is a Linux only stressor, see ioctl_iflags(2) for more details ๐Ÿ‘‘
  • --inode-flags-ops N โ€” stop the inode-flags workers after N ioctl flag setting attempts โœ…

๐ŸŽ€ Inotify stressor ๐ŸŽ€

  • --inotify N โ€” start N workers performing file system activities such as making/deleting files/directories, moving files, etc. to stress exercise the various inotify events (Linux only) ๐Ÿ‘€โœจ
  • --inotify-ops N โ€” stop inotify stress workers after N inotify bogo operations ๐Ÿ’…

๐Ÿ“ Insertion sort stressor ๐Ÿ“

  • --insertionsort N โ€” start N workers that sort 32 bit integers using insertion sort ๐Ÿ”ข
  • --insertionsort-ops N โ€” stop insertionsort stress workers after N bogo insertion sorts โœ…
  • --insertionsort-size N โ€” specify number of 32 bit integers to sort, default is 16384 (16 ร— 1024) ๐ŸŽ€

๐Ÿ‘‘ Integer Math Operations ๐Ÿ‘‘

  • --intmath N โ€” start N workers that perform addition, subtraction, multiplication, division and modulo math operations on 128, 64, 32, 16 and 8 bit signed integers ๐Ÿงฎ๐Ÿ’–
  • --intmath-fast โ€” when available use int_fast64_t, int_fast32_t, int_fast16_t and int_fast8_t types instead of int64_t, int32_t, int16_t and int8_t types. Note that these may or may not be faster than normal integer operations depending on the compiler ๐Ÿคทโ€โ™€๏ธ ngl it's a whole vibe check for your compiler
  • --intmath-method method โ€” select the integer math method to use, available methods are:
    • all โ€” iterate over all the following integer methods:
    • add128 โ€” 128 bit signed integer addition
    • add64 โ€” 64 bit signed integer addition
    • add32 โ€” 32 bit signed integer addition
    • add16 โ€” 16 bit signed integer addition
    • add8 โ€” 8 bit signed integer addition
    • sub128 โ€” 128 bit signed integer subtraction
    • sub64 โ€” 64 bit signed integer subtraction
    • sub32 โ€” 32 bit signed integer subtraction
    • sub16 โ€” 16 bit signed integer subtraction
    • sub8 โ€” 8 bit signed integer subtraction
    • mul128 โ€” 128 bit signed integer multiplication
    • mul64 โ€” 64 bit signed integer multiplication
    • mul32 โ€” 32 bit signed integer multiplication
    • mul16 โ€” 16 bit signed integer multiplication
    • mul8 โ€” 8 bit signed integer multiplication
    • div128 โ€” 128 bit signed integer division
    • div64 โ€” 64 bit signed integer division
    • div32 โ€” 32 bit signed integer division
    • div16 โ€” 16 bit signed integer division
    • div8 โ€” 8 bit signed integer division
    • mod128 โ€” 128 bit signed integer modulo
    • mod64 โ€” 64 bit signed integer modulo
    • mod32 โ€” 32 bit signed integer modulo
    • mod16 โ€” 16 bit signed integer modulo
    • mod8 โ€” 8 bit signed integer modulo

for the --intmath-fast option, the following methods are available:

  • all โ€” iterate over all the following integer methods:
    • addfast64 โ€” fast 64 bit signed integer addition
    • addfast32 โ€” fast 32 bit signed integer addition
    • addfast16 โ€” fast 16 bit signed integer addition
    • addfast8 โ€” fast 8 bit signed integer addition
    • subfast64 โ€” fast 64 bit signed integer subtraction
    • subfast32 โ€” fast 32 bit signed integer subtraction
    • subfast16 โ€” fast 16 bit signed integer subtraction
    • subfast8 โ€” fast 8 bit signed integer subtraction
    • mulfast64 โ€” fast 64 bit signed integer multiplication
    • mulfast32 โ€” fast 32 bit signed integer multiplication
    • mulfast16 โ€” fast 16 bit signed integer multiplication
    • mulfast8 โ€” fast 8 bit signed integer multiplication
    • divfast64 โ€” fast 64 bit signed integer division
    • divfast32 โ€” fast 32 bit signed integer division
    • divfast16 โ€” fast 16 bit signed integer division
    • divfast8 โ€” fast 8 bit signed integer division
    • modfast64 โ€” fast 64 bit signed integer modulo
    • modfast32 โ€” fast 32 bit signed integer modulo
    • modfast16 โ€” fast 16 bit signed integer modulo
    • modfast8 โ€” fast 8 bit signed integer modulo
  • --intmath-ops N โ€” stop the intmath workers after N bogo integer math operations. bye bestie ๐Ÿ’…

๐ŸŒธ Data synchronization (sync) stressor ๐ŸŒธ

  • -i N, --io N โ€” start N workers that are continuously calling sync(2) to commit the buffer cache to disk ๐Ÿซถ. You can totally run this alongside the --hdd stressor, they're besties. Heads up though: this is a legacy stressor โ€” it's the one that plays nice with the original stress tool, so it's giving "vintage icon" energy ๐Ÿ‘‘
  • --io-ops N โ€” stop the io stress workers after N bogo operations. periodt โœจ

๐Ÿฆ‹ IO mixing stressor ๐Ÿฆ‹

  • --iomix N โ€” start N workers doing a whole mix of stuff: sequential, random and memory mapped read/write operations, plus random copy file read/writes, direct I/O read/writes, forced sync'ing and โ€” if you're running as root โ€” cache dropping ๐Ÿ˜ญ. Multiple child processes get spawned and they all share a single file, each one doing different I/O operations on that same file. it's giving chaos cooperative ๐Ÿ’€
  • --iomix-bytes N โ€” write N bytes for each iomix worker process, default is 1 GB. You can also spec it as a % of free space on the file system, or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g โœจ
  • --iomix-ops N โ€” stop the iomix stress workers after N bogo iomix I/O operations.

๐ŸŽ€ Ioport stressor (x86 Linux) ๐ŸŽ€

  • --ioport N โ€” start N workers doing bursts of 16 reads and 16 writes of ioport 0x80. x86 Linux systems only bestie ๐Ÿซถ. And like, I/O performed on x86 platforms on port 0x80 will cause delays on the CPU doing the I/O โ€” that's the whole point, no cap.
  • --ioport-ops N โ€” stop the ioport stressors after N bogo I/O operations
  • --ioport-opts [ in | out | inout ] โ€” specify the io operation to be performed. The default is both in and out. So you specify if port reads are in, port read writes are out, or reads and writes are inout ๐Ÿ’…
  • --ioport-port [ post | vga-dac-r | bochs-debug ] โ€” select the x86 I/O port to use: post (that's the Power-On-Self-Test port 0x80), vga-dac-r (the VGA DAC Red port 0x3c8) or bochs-debug (the Bochs debug port 0xe9) ๐Ÿ‘‘

๐Ÿ’œ IO scheduling class and priority stressor ๐Ÿ’œ

  • --ioprio N โ€” start N workers that exercise the ioprio_get(2) and ioprio_set(2) system calls. Linux only, obviously ๐Ÿ˜Œ
  • --ioprio-ops N โ€” stop after N io priority bogo operations.

โญ Io-uring stressor โญ

  • --io-uring N โ€” start N workers doing various io-uring file operations using the Linux io-uring interface ๐Ÿ”ฅ
  • --io-uring-entries N โ€” specify the number of io-uring ring entries.
  • --io-uring-ops N โ€” stop after N rounds of io-uring operations.
  • --io-uring-rand โ€” randomize the order of io-uring operations and the file seek locations. chaos mode: activated ๐ŸŒˆ

๐Ÿ‘‘ IPsec multi-buffer cryptographic stressor ๐Ÿ‘‘

  • --ipsec-mb N โ€” start N workers that do cryptographic processing using the highly optimized Intel Multi-Buffer Crypto for IPsec library ๐Ÿงš. Depending on the features available, SSE, AVX, AVX and AVX512 CPU features will be used on data encrypted by SHA, DES, CMAC, CTR, HMAC MD5, HMAC SHA1 and HMAC SHA512 cryptographic routines. Only available for x86-64 modern Intel CPUs โ€” sorry to everyone else, it's giving exclusive ๐Ÿ’€
  • --ipsec-mb-feature [ sse | avx2 | avx512 | noaesni ] โ€” just use the specified processor CPU feature. By default, all the available features for the CPU are exercised.
  • --ipsec-mb-jobs N โ€” process N multi-block rounds of cryptographic processing per iteration. Default is 256.
  • --ipsec-mb-method [ all | cmac | ctr | des | hmac-md5 | hmac-sha1 | hmac-sha512 | sha ] โ€” select the ipsec-mb crypto/integrity method โœจ
  • --ipsec-mb-ops N โ€” stop after N rounds of processing of data using the cryptographic routines.

๐ŸŒˆ System interval timer stressor ๐ŸŒˆ

  • --itimer N โ€” start N workers that exercise the system interval timers โฐ. This sets up an ITIMER_PROF itimer that generates a SIGPROF signal. The default frequency for the itimer is 1 MHz, however the Linux kernel will set this to be no more than the jiffy setting โ€” so high frequency SIGPROF signals are not normally possible, ngl ๐Ÿ˜ญ. A busy loop spins on getitimer(2) calls to consume CPU and hence decrement the itimer based on amount of time spent in CPU and system time.
  • --itimer-freq F โ€” run itimer at F Hz; range from 1 to 1000000 Hz. Normally the highest frequency is limited by the number of jiffy ticks per second, so running above 1000 Hz is difficult to attain in practice ๐Ÿซถ
  • --itimer-ops N โ€” stop itimer stress workers after N bogo itimer SIGPROF signals.
  • --itimer-rand โ€” select an interval timer frequency based around the interval timer frequency ยฑ12.5% random jitter. This tries to force more variability in the timer interval so the scheduling is less predictable โ€” main character energy, keeping the scheduler guessing ๐Ÿ’…

๐Ÿ“ Jpeg compression stressor ๐Ÿ“

  • --jpeg N โ€” start N workers doing jpeg compression on a machine generated plasma field image ๐Ÿ–ผ๏ธ. The default image is a plasma field, but different image types may be selected. The starting raster line changes on each compression iteration to cycle around the data โ€” iconic.
  • --jpeg-height H โ€” use a RGB sample image height of H pixels. Default is 512 pixels.
  • --jpeg-image [ brown | flat | gradient | noise | plasma | xstripes ] โ€” select the source image type to be compressed. Available image types:
    • brown โ€” brown noise, red and green values vary by a 3 bit value, blue values vary by a 2 bit value.
    • flat โ€” a single random colour for the entire image.
    • gradient โ€” linear gradient of the red, green and blue components across the width and height of the image.
    • noise โ€” random white noise for red, green, blue values.
    • plasma โ€” plasma field with smooth colour transitions and hard boundary edges.
    • xstripes โ€” a random colour for each horizontal line. ate ๐Ÿ’…
  • --jpeg-ops N โ€” stop after N jpeg compression operations.
  • --jpeg-quality Q โ€” use the compression quality Q. The range is 1..100 (1 lowest, 100 highest), with a default of 95 โœจ
  • --jpeg-width H โ€” use a RGB sample image width of H pixels. The default is 512 pixels.

๐Ÿงš Judy array stressor ๐Ÿงš

  • --judy N โ€” start N workers that insert, search and delete 32 bit integers in a Judy array using a predictable yet sparse array index ๐Ÿฆ‹. By default, there are 131072 integers used in the Judy array. This is a useful method to exercise random access of memory and processor cache โ€” lowkey obsessed with cache behaviour.
  • --judy-ops N โ€” stop the judy workers after N bogo judy operations are completed.
  • --judy-size N โ€” specify the size (number of 32 bit integers) in the Judy array to exercise. Size can be from 1 K to 4 M 32 bit integers.

๐Ÿ’€ Kcmp stressor (Linux) ๐Ÿ’€

  • --kcmp N โ€” start N workers that use kcmp(2) to compare parent and child processes to determine if they share kernel resources ๐Ÿ‘€. Supported only for Linux, and it requires the CAP_SYS_PTRACE capability โ€” so no cap, you actually need the perms.
  • --kcmp-ops N โ€” stop kcmp workers after N bogo kcmp operations.

๐Ÿ”ฅ Kernel key management stressor ๐Ÿ”ฅ

  • --key N โ€” start N workers that create and manipulate keys using add_key(2) and ketctl(2) ๐Ÿ”‘. As many keys are created as the per user limit allows, and then the following keyctl commands are exercised on each key: KEYCTL_SET_TIMEOUT, KEYCTL_DESCRIBE, KEYCTL_UPDATE, KEYCTL_READ, KEYCTL_CLEAR and KEYCTL_INVALIDATE. keys on keys on keys fr fr.
  • --key-ops N โ€” stop key workers after N bogo key operations.

๐Ÿ™ˆ Process signals stressor ๐Ÿ™ˆ

  • --kill N โ€” start N workers sending SIGUSR1 kill(2) signals to a SIG_IGN signal handler in the stressor, and SIGUSR1 kill signals to a child stressor with a SIGUSR1 handler ๐Ÿ’€. Most of the process time will end up in kernel space โ€” it's giving kernel resident.
  • --kill-ops N โ€” stop kill workers after N bogo kill operations.

๐ŸŒธ Syslog stressor (Linux) ๐ŸŒธ

  • --klog N โ€” start N workers exercising the kernel syslog(2) system call ๐Ÿ“œ. This will attempt to read the kernel log with various sized read buffers. Linux only, bestie.
  • --klog-ops N โ€” stop klog workers after N syslog operations.

๐Ÿ’ป KVM stressor ๐Ÿ’ป

  • --kvm N โ€” starts N workers that literally create, run, and then destroy a minimal virtual machine, bestie. 64 bit ARM, RISC-V and x86 ARM Linux only. On x86 the VM reads, increments and writes to port 0x80 in a spin loop and the stressor handles the I/O transactions. On ARM64 and RISC-V the VM writes to a MMIO region and the stressor handles the MMIO exits. It's giving tiny hypervisor era ๐Ÿงš
  • --kvm-ops N โ€” stop the kvm stressors after N virtual machines have been created, run and destroyed.

๐Ÿง  CPU L1 cache stressor ๐Ÿง 

  • --l1cache N โ€” start N workers that exercise the CPU level 1 cache with reads and writes. So here's the tea: a cache aligned buffer that's twice the level 1 cache size gets read and then written in level 1 cache set sized steps over each level 1 cache set. This is designed to exercise cache block evictions. The bogo-op count measures the number of million cache lines touched. Where possible, the level 1 cache geometry is determined from the kernel โ€” but ngl, that's not possible on some architectures or kernels, so you might need to specify these manually. You can specify 3 out of the 4 cache geometric parameters, and they are as follows ๐Ÿ‘‡
  • --l1cache-line-size N โ€” specify the level 1 cache line size (in bytes)
  • --l1cache-method [ forward | random | reverse ] โ€” select the method of exercising a l1cache sized buffer. Options are forward scan, random pick of random bytes to exercise, and reverse scans in reverse. The default is the forward scan.
  • --l1cache-mlock โ€” attempt to mlock(2) the l1cache size buffer into memory to prevent it from being swapped out.
  • --l1cache-ops N โ€” specify the number of cache read/write bogo-op loops to run
  • --l1cache-sets N โ€” specify the number of level 1 cache sets
  • --l1cache-size N โ€” specify the level 1 cache size (in bytes)
  • --l1cache-ways N โ€” specify the number of level 1 cache ways

๐Ÿ”’ Landlock stressor (Linux โ‰ฅ 5.13) ๐Ÿ”’

  • --landlock N โ€” start N workers that exercise Linux 5.13 landlocking. A whole range of landlock_create_ruleset(2) flags are exercised with a read only file rule to see if a directory can be accessed and a read-write file create can be blocked. Each ruleset attempt is exercised in a new child context and that's literally the limiting factor on the speed of the stressor. Sandbox vibes only ๐Ÿ’…
  • --landlock-ops N โ€” stop the landlock stressors after N landlock ruleset bogo operations.

๐Ÿ“„ File lease stressor ๐Ÿ“„

  • --lease N โ€” start N workers locking, unlocking and breaking leases via the fcntl(2) F_SETLEASE operation. The parent processes continually lock and unlock a lease on a file while a user selectable number of child processes open the file with a non-blocking open to generate SIGIO lease breaking notifications to the parent. Heads up: this stressor is only available if F_SETLEASE, F_WRLCK and F_UNLCK support is provided by fcntl(2).
  • --lease-breakers N โ€” start N lease breaker child processes per lease worker. Normally one child is plenty to force many SIGIO lease breaking notification signals to the parent, however, this option allows one to specify more child processes if required.
  • --lease-ops N โ€” stop lease workers after N bogo operations.

๐Ÿ’ก LED stressor (Linux) ๐Ÿ’ก

  • --led N โ€” start N workers that exercise the /sys/class/leds interfaces to set LED brightness levels and the various trigger settings. This needs to be run with root privilege to be able to write to these settings successfully. Non-root privilege will ignore failed writes. Sparkle mode: activated โœจ
  • --led-ops N โ€” stop after N interfaces are exercised.

  • --link N โ€” start N workers creating and removing hardlinks.
  • --link-ops N โ€” stop link stress workers after N bogo operations.
  • --link-sync โ€” sync dirty data and metadata to disk.

๐Ÿ“‹ List data structures stressor ๐Ÿ“‹

  • --list N โ€” start N workers that exercise list data structures. The default is to add, find and remove 5000 64 bit integers into circleq (doubly linked circle queue), list (doubly linked list), slist (singly linked list), slistt (singly linked list using tail), stailq (singly linked tail queue) and tailq (doubly linked tail queue) lists. The intention of this stressor is to exercise memory and cache with the various list operations. Data structures? Obsessed.
  • --list-method [ all | circleq | list | slist | stailq | tailq ] โ€” specify the list to be used. By default, all the list methods are used (the all option).
  • --list-ops N โ€” stop list stressors after N bogo ops. A bogo op covers the addition, finding and removing all the items into the list(s).
  • --list-size N โ€” specify the size of the list, where N is the number of 64 bit integers to be added into the list.

๐Ÿ—„๏ธ Last level of cache stressor ๐Ÿ—„๏ธ

  • --llc-affinity N โ€” start N workers that exercise the last level of cache (LLC) by read/write activity across a LLC sized buffer and then changing CPU affinity after each round of read/writes. This can cause non-local memory stalls and LLC read/write misses. Chaos, but make it cache-coherent.
  • --llc-affinity-clflush โ€” where possible, flush cachelines after each cacheline write, x86 and ppc64 only.
  • --llc-affinity-mlock โ€” attempt to mlock(2) the LLC sized buffer into memory to prevent it from being swapped out.
  • --llc-affinity-numa โ€” assign memory mapped pages to randomly selected NUMA nodes. This is disabled for systems that do not support NUMA.
  • --llc-affinity-ops N โ€” stop after N rounds of LLC read/writes.
  • --llc-affinity-size N โ€” override the default LLC cache size setting to N bytes. One can specify the in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g.

๐Ÿ“ˆ Load average (loadavg) stressor ๐Ÿ“ˆ

  • --loadavg N โ€” start N workers that attempt to create thousands of pthreads that run at the lowest nice priority to force very high load averages. Linux systems will also perform some I/O writes as pending I/O is also factored into system load accounting. Go off, load average ๐Ÿ”ฅ
  • --loadavg-max N โ€” set the maximum number of pthreads to create to N. N may be reduced if there is a system limit on the number of pthreads that can be created.
  • --loadavg-ops N โ€” stop loadavg workers after N bogo scheduling yields by the pthreads have been reached.

๐Ÿ” Lock and increment memory stressor (x86 and ARM) ๐Ÿ”

  • --lockbus N โ€” start N workers that rapidly lock and increment 64 bytes of randomly chosen memory from a 16 MB mmap'd region (Intel x86 and ARM CPUs only). 50% of the mmap'd region is shared between all lockbus stressor instances, 50% is local to each lockbus stressor. This stressor will cause cacheline misses and stalling of CPUs. Pages are spread randomly across NUMA nodes to exercise NUMA bus locking for NUMA systems.
  • --lockbus-bytes N โ€” exercise bus locking over N bytes, the default is 16 MB. One can specify the size in as % of total available memory or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g.
  • --lockbus-nosplit โ€” disable split locks that lock across cache line boundaries.
  • --lockbus-ops N โ€” stop lockbus workers after N bogo operations.

๐Ÿงท POSIX lock (F_SETLK/F_GETLK) stressor ๐Ÿงท

  • --locka N โ€” start N workers that randomly lock and unlock regions of a file using the POSIX advisory locking mechanism (see fcntl(2), F_SETLK, F_GETLK). Each worker creates a 1024 KB file and attempts to hold a maximum of 1024 concurrent locks with a child process that also tries to hold 1024 concurrent locks. Old locks are unlocked in a first-in, first-out basis. Very demure, very FIFO.
  • --locka-ops N โ€” stop locka workers after N bogo locka operations.

๐Ÿ” POSIX lock (lockf) stressor ๐Ÿ”

  • --lockf N โ€” start N workers that randomly lock and unlock regions of a file using the POSIX lockf(3) locking mechanism. Each worker creates a 64 KB file and attempts to hold a maximum of 1024 concurrent locks with a child process that also tries to hold 1024 concurrent locks. Old locks are unlocked in a first-in, first-out basis.
  • --lockf-nonblock โ€” instead of using blocking F_LOCK lockf(3) commands, use non-blocking F_TLOCK commands and re-try if the lock fails. This creates extra system call overhead and CPU utilisation as the number of lockf workers increases and should increase locking contention.
  • --lockf-ops N โ€” stop lockf workers after N bogo lockf operations.

๐ŸŽ›๏ธ Mixed file lock stressor (locka, lockf, lockofd) ๐ŸŽ›๏ธ

  • --lockmix N โ€” start N workers that randomly lock and unlock regions of a file using the BSD flock(2), locka (advisory), POSIX lockf(3) and Linux open file lock (lockofd) locking mechanisms. Each worker creates a 1024 KB file and attempts to hold a maximum of 1024 concurrent locks with a child process that also tries to hold 1024 concurrent locks. Old locks are unlocked in a first-in, first-out basis. A little bit of every lock, main character energy ๐Ÿ‘‘
  • --lockmix-ops N โ€” stop lockmix workers after N bogo lockmix operations.

๐ŸŽ€ Linux open file lock (ofd F_OFD_SETLK/F_OFD_GETLK) stressor

  • --lockofd N โ€” spins up N workers that just... randomly lock and unlock regions of a file, bestie, using the Linux open file description locks (peep fcntl(2), F_OFD_SETLK, F_OFD_GETLK). Every worker makes its own 1024 KB file and tries to hold a max of 1024 concurrent locks, with a child process also trying to hold 1024 concurrent locks. Old locks get unlocked first-in, first-out. It's giving organized chaos ๐Ÿ’…
  • --lockofd-ops N โ€” stops the lockofd workers after N bogo lockofd operations.

๐ŸŒˆ Logarithmic functions stressor

  • --logmath N โ€” start N workers that exercise a whole bunch of libm logarithmic functions with input values 1 to 10000. Results get sanity checked so no variation sneaks in after each round of 10000 computations. No cap, math stays math ๐Ÿงฎโœจ
  • --logmath-ops N โ€” stop after N logarithmic bogo-operation loops.
  • --logmath-method method โ€” pick which logarithmic function to exercise. Here's the full menu, iykyk:
    • all โ€” iterate over all the below logarithmic functions methods
    • clog โ€” double complex natural logarithm
    • clogf โ€” float complex natural logarithm
    • clogl โ€” long double complex natural logarithm
    • log โ€” double natural logarithm
    • logf โ€” float natural logarithm
    • logl โ€” long double natural logarithm
    • logb โ€” get exponent of a double
    • logbf โ€” get exponent of a float
    • logbl โ€” get exponent of a long double
    • log10 โ€” double base-10 logarithm
    • log10f โ€” float base-10 logarithm
    • log10l โ€” long double base-10 logarithm
    • log2 โ€” double base-2 logarithm
    • log2f โ€” float base-2 logarithm
    • log2l โ€” long double base-2 logarithm

๐Ÿฆ‹ Long jump (longjmp) stressor

  • --longjmp N โ€” start N workers that exercise setjmp(3)/longjmp(3) by rapid looping on longjmp calls. Jumping around like it's a group chat with 12 conversations going at once ๐Ÿ˜ญ
  • --longjmp-ops N โ€” stop longjmp stress workers after N bogo longjmp operations (1 bogo op is 1000 longjmp calls).

๐Ÿ“ Loopback stressor (Linux)

  • --loop N โ€” start N workers that exercise the loopback control device. This creates 2 MB loopback devices, expands them to double this size, does some loopback status information get and set operations, then destroys them. Linux only, and it needs the CAP_SYS_ADMIN capability โ€” so like, bring permissions or don't come at all ๐Ÿ’€
  • --loop-bytes N โ€” specifies the size of the loop device in bytes, range 1MB to 1GB, the default is 2MB.
  • --loop-ops N โ€” stop after N bogo loopback creation/deletion operations.

๐ŸŒธ Linear search stressor

  • --lsearch N โ€” start N workers that linear search an unsorted array of 32 bit integers using lsearch(3). By default there are 8192 elements in the array. Honestly a great way to exercise sequential access of memory and processor cache โ€” underrated icon behavior fr fr ๐Ÿ‘‘
  • --lsearch-method [ lsearch-libc | lsearch-nonlibc | lsearch-sentinel ] โ€” select either the libc implementation of lsearch, or a slightly optimized non-libc implementation of lsearch, or an lsearch that uses the search key as the end of array sentinel to remove an index compare per loop. Default is the libc implementation if it exists, otherwise the non-libc version. Choose your fighter โœจ
  • --lsearch-ops N โ€” stop the lsearch workers after N bogo lsearch operations are completed.
  • --lsearch-size N โ€” specify the size (number of 32 bit integers) in the array to lsearch. Size can be from 1 K to 4 M.

๐Ÿ’œ Linux Security Modules system call stressor

  • --lsm N โ€” start N workers that exercise the LSM system calls lsm_list_modules(2) and lsm_get_self_attr(2), (Linux only). Every bogo-op loop fetches a list of available security modules and fetches LSM attributes, plus some invalid LSM system calls to exercise error handling. Gotta test the bad paths too, bestie ๐Ÿซถ
  • --lsm-ops N โ€” stop after N loops of fetching security modules lists and fetching LSM attributes.

๐Ÿ”ฅ Madvise stressor

  • --madvise N โ€” start N workers that apply random madvise(2) advise settings on pages of a 4 MB file backed shared memory mapping.
  • --madvise-bytes N โ€” mmap N bytes for per madvise worker for the file backed shared memory mapping. The range is 4K to 64M, and the default is 4 MB. You can specify the size as % of total available memory, or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g.
  • --madvise-hwpoison โ€” enable MADV_HWPOISON page poisoning (if available, only when run as root). This will page poison a few pages and will cause kernel error messages to be reported. โš ๏ธ Heads up: it literally poisons pages on purpose, so the kernel screaming in the logs is the whole point.
  • --madvise-ops N โ€” stop madvise stressors after N bogo madvise operations.

โญ Memory allocation stressor

  • --malloc N โ€” start N workers continuously calling malloc(3), calloc(3), realloc(3), posix_memalign(3), aligned_alloc(3), memalign(3) and free(3). By default up to 65536 allocations can be active at any point, but you can change that with the --malloc-max option. Allocation, reallocation and freeing are chosen at random; 50% of the time memory is allocation (via one of malloc, calloc or realloc, posix_memalign, aligned_alloc, memalign) and 50% of the time allocations are free'd. Allocation sizes are also random, with the maximum allocation size controlled by the --malloc-bytes option, the default size being 64 K. And the worker gets re-started if it is killed by the out of memory (OOM) killer โ€” it simply refuses to stay down ๐Ÿ˜ญ๐Ÿ’€
  • --malloc-bytes N โ€” maximum per allocation/reallocation size. Allocations are randomly selected from 1 to N bytes. You can specify the size as % of total available memory, or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g. Large allocation sizes cause the memory allocator to use mmap(2) rather than expanding the heap using brk(2).
  • --malloc-max N โ€” maximum number of active allocations allowed. Allocations are chosen at random and placed in an allocation slot. Because it's about a 50%/50% split between allocation and freeing, typically half of the allocation slots are in use at any one time.
  • --malloc-mlock โ€” attempt to mlock(2) the allocations into memory to prevent them from being swapped out. Pinning it down, no escaping ๐Ÿ‘€
  • --malloc-ops N โ€” stop after N malloc bogo operations. One bogo operation relates to a successful malloc(3), calloc(3), realloc(3), posix_memalign(3), aligned_alloc(3) or memalign(3) call.
  • --malloc-pthreads N โ€” specify number of malloc stressing concurrent pthreads to run. The default is 0 (just one main process, no pthreads). This option will do nothing if pthreads are not supported.
  • --malloc-thresh N โ€” specify the threshold where malloc uses mmap(2) instead of sbrk(2) to allocate more memory. This is only available on systems that provide the GNU C mallopt(3) tuning function.
  • --malloc-touch โ€” touch every allocated page to force pages to be populated in memory. This will increase the memory pressure and exercise the virtual memory harder. By default the malloc stressor will madvise pages into memory or use mincore to check for non-resident memory pages and try to force them into memory; this option aggressively forces pages to be memory resident. Maximum main character energy for your RAM ๐Ÿ’…
  • --malloc-trim โ€” periodically trim memory allocation by attempting to release free memory from the heap every 65536 allocation iterations. This can be a time consuming operation. It's only available with libc malloc implementations that support malloc_trim(3).
  • --malloc-zerofree โ€” zero allocated memory before free'ing. This can be useful in touching broken allocations and triggering failures. Also useful for forcing extra cache/memory writes.

๐Ÿงš 2D Matrix stressor

  • --matrix N โ€” start N workers that perform various matrix operations on floating point values. Testing on 64 bit x86 hardware shows that this provides a good mix of memory, cache and floating point operations, and is an excellent way to make a CPU run hot. ๐Ÿ”ฅ Literally the "make it sweat" button.

By default, this will exercise all the matrix stress methods one by one on a 128 ร— 128 element matrix. You can specify a specific matrix stress method with the --matrix-method option.

  • --matrix-method method โ€” specify a matrix stress method. Available matrix stress methods are described as follows:
    • all โ€” iterate over all the below matrix stress methods
    • add โ€” add two N ร— N matrices
    • copy โ€” copy one N ร— N matrix to another
    • div โ€” divide an N ร— N matrix by a scalar
    • frobenius โ€” Frobenius product of two N ร— N matrices
    • hadamard โ€” Hadamard product of two N ร— N matrices
    • identity โ€” create an N ร— N identity matrix
    • mean โ€” arithmetic mean of two N ร— N matrices
    • mult โ€” multiply an N ร— N matrix by a scalar
    • negate โ€” negate an N ร— N matrix
    • prod โ€” product of two N ร— N matrices
    • sub โ€” subtract one N ร— N matrix from another N ร— N matrix
    • square โ€” multiply an N ร— N matrix by itself
    • trans โ€” transpose an N ร— N matrix
    • zero โ€” zero an N ร— N matrix
  • --matrix-ops N โ€” stop matrix stress workers after N bogo operations.
  • --matrix-size N โ€” sets the size of your matrices: it's an N ร— N situation, bestie ๐ŸŽ€. Small values = a floating point compute throughput bound stressor (number crunching szn). Big values = a cache and/or memory bandwidth bound stressor (memory go brrr). Pick your fighter ๐Ÿ’…
  • --matrix-yx โ€” does the matrix ops in y by x order instead of the default x by y. Ngl this ordering is suboptimal compared to the default and will give you more data cache stalls ๐Ÿ˜ญ so like, only if you're being messy on purpose.

๐ŸงŠ 3D Matrix stressor ๐ŸงŠ

  • --matrix-3d N โ€” starts N workers doing various 3D matrix operations on floating point values โœจ. Testing on 64 bit x86 hardware shows this gives a good mix of memory, cache AND floating point operations โ€” like, it's literally an excellent way to make a CPU run hot ๐Ÿ”ฅ

By default it exercises all the 3D matrix stress methods one by one on a 128 ร— 128 ร— 128 element matrix ๐Ÿซถ. If you want one specific method, say it with --matrix-3d-method, iykyk.

  • --matrix-3d-method method โ€” pick your 3D matrix stress method ๐Ÿ‘‘. Here's the menu:
    • all โ€” iterate over all the below matrix stress methods
    • add โ€” add two N ร— N ร— N matrices
    • copy โ€” copy one N ร— N ร— N matrix to another
    • div โ€” divide an N ร— N ร— N matrix by a scalar
    • frobenius โ€” Frobenius product of two N ร— N ร— N matrices
    • hadamard โ€” Hadamard product of two N ร— N ร— N matrices
    • identity โ€” create an N ร— N ร— N identity matrix
    • mean โ€” arithmetic mean of two N ร— N ร— N matrices
    • mult โ€” multiply an N ร— N ร— N matrix by a scalar
    • negate โ€” negate an N ร— N ร— N matrix
    • sub โ€” subtract one N ร— N ร— N matrix from another N ร— N ร— N matrix
    • trans โ€” transpose an N ร— N ร— N matrix
    • zero โ€” zero an N ร— N ร— N matrix
  • --matrix-3d-ops N โ€” stops the 3D matrix stress workers after N bogo operations โญ
  • --matrix-3d-size N โ€” sets the N ร— N ร— N size of the matrices ๐Ÿฆ‹. Small = floating point compute throughput bound stressor, large = cache and/or memory bandwidth bound stressor. Same vibe check as its 2D sibling fr.
  • --matrix-3d-zyx โ€” does the matrix ops in z by y by x order instead of the default x by y by z. Again: suboptimal ordering compared to the default, and it will perform more data cache stalls ๐Ÿ’€

๐ŸŒธ Memory contention stressor ๐ŸŒธ

  • --mcontend N โ€” starts N workers that produce memory contention read/write patterns ๐Ÿ‘€. Each stressor runs with 5 threads that read and write to two different mappings of the same underlying physical page. Various caching operations also get exercised to cause sub-optimal memory access patterns. And the threads randomly change CPU affinity to exercise CPU and memory migration stress โ€” chaos as a feature, periodt ๐Ÿ’…
  • --mcontend-numa โ€” assigns memory mapped pages to randomly selected NUMA nodes ๐Ÿงš. Disabled for systems that don't support NUMA, no cap.
  • --mcontend-ops N โ€” stops mcontend stressors after N bogo read/write operations โœจ

๐Ÿ”ฎ Memory barrier stressor (Linux) ๐Ÿ”ฎ

  • --membarrier N โ€” starts N workers that exercise the membarrier(2) system call. Linux only, bestie ๐Ÿง
  • --membarrier-ops N โ€” stops membarrier stress workers after N bogo membarrier operations ๐Ÿ’œ

๐Ÿ“‹ Memory copy (memcpy) stressor ๐Ÿ“‹

  • --memcpy N โ€” starts N workers that copy data to and from a buffer using memcpy(3) and then move the data in the buffer with memmove(3) with 3 different alignments ๐ŸŽ€. This exercises the data cache and memory copying, slay.
  • --memcpy-method [ all | libc | builtin | naive | naive_o0 .. naive_o3 ] โ€” picks your memcpy copying method ๐Ÿ‘‘. The options, bestie:
    • all โ€” use libc, builtin and naรฏve methods
    • libc โ€” use libc memcpy and memmove functions, this is the default
    • builtin โ€” use the compiler built in optimized memcpy and memmove functions
    • naive โ€” use naรฏve byte by byte copying and memory moving build with default compiler optimization flags
    • naive_o0 โ€” use unoptimized naรฏve byte by byte copying and memory moving
    • naive_o1 โ€” use unoptimized naรฏve byte by byte copying and memory moving with -O1 optimization
    • naive_o2 โ€” use optimized naรฏve byte by byte copying and memory moving build with -O2 optimization and where possible use CPU specific optimizations
    • naive_o3 โ€” use optimized naรฏve byte by byte copying and memory moving build with -O3 optimization and where possible use CPU specific optimizations
  • --memcpy-ops N โ€” stops memcpy stress workers after N bogo memcpy operations โญ

๐Ÿ—‚๏ธ Anonymous file (memfd) stressor ๐Ÿ—‚๏ธ

  • --memfd N โ€” starts N workers that create allocations of 1024 pages using memfd_create(2) and ftruncate(2) for allocation and mmap(2) to map the allocation into the process address space. (Linux only ๐Ÿง).
  • --memfd-bytes N โ€” allocates N bytes per memfd stress worker, the default is 256 MB. You can specify the size as a % of total available memory, or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g ๐Ÿ’–
  • --memfd-fds N โ€” creates N memfd file descriptors, the default is 256. With this option you can select 8 to 4096 memfd file descriptions ๐Ÿฆ‹
  • --memfd-madvise โ€” enables random madvise page advice on memfd memory mapped regions to add a little more VM exercising โœจ (a little enrichment in its enclosure, if you will).
  • --memfd-mlock โ€” attempts to mlock(2) mmap'd pages into memory, causing more memory pressure by preventing pages from being swapped out ๐Ÿ’…
  • --memfd-numa โ€” assigns memory mapped pages to randomly selected NUMA nodes ๐Ÿงš. Disabled for systems that do not support NUMA.
  • --memfd-ops N โ€” stop after N memfd-create(2) bogo operations โญ
  • --memfd-zap-pte โ€” exercises zapping page-table-entries to try to reproduce a Linux kernel bug that was fixed by commit 5abfd71d936a8aefd9f9ccd299dea7a164a5d455 "mm: don't skip swap entry even if zap_details specified" ๐Ÿ‘€. Heads up: this will slow the stressor down significantly and hence is an opt-in memfd stressor option.

๐Ÿ”ฅ Memory hotplug stressor (Linux) ๐Ÿ”ฅ

  • --memhotplug N โ€” starts N workers that offline and online memory hotplug regions. Linux only and requires CAP_SYS_ADMIN capabilities ๐Ÿ‘‘
  • --memhotplug-mmap โ€” enables random 1 K to 1 MB memory mapping/unmappings before each offline event ๐ŸŽ€
  • --memhotplug-ops N โ€” stops memhotplug stressors after N memory offline and online bogo operations โœจ

๐ŸŒˆ Memory read/write stressor ๐ŸŒˆ

  • --memrate N โ€” starts N workers that exercise a buffer with 1024, 512, 256, 128, 64, 32, 16 and 8 bit reads and writes ๐Ÿ˜ค. Let me break it down bestie:
    • 1024, 512 and 256 reads and writes are available with compilers that support integer vectors.
    • x86-64 CPUs that support uncached (non-temporal "nt") writes also exercise 128, 64 and 32 writes, providing higher write rates than the normal cached writes ๐Ÿ”ฅ
    • x86-64 also exercises repeated string stores using 64, 32, 16 and 8 bit writes.
    • CPUs that support prefetching reads also exercise 64 prefetched "pf" reads.

This memory stressor also lets you specify the maximum read and write rates. The stressors run at maximum speed if no read or write rates are specified ๐Ÿ’จ

  • --memrate-bytes N โ€” specifies the size of the memory buffer being exercised. The default size is 256 MB. You can specify the size in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g, or with cache sizes L1, L2, L3 or LLC (lower level cache size) ๐ŸŽ€
  • --memrate-discontiguous โ€” attempts to make mmap'd physical pages discontiguous by forcing pages to be in 'randomly' mixed physical page locations ๐Ÿ™ˆ chaos mode: enabled.
  • --memrate-flush โ€” flushes cache between each memory exercising test to remove caching benefits in memory rate metrics ๐Ÿงผ (no sneaky free performance from the cache, we're measuring the real thing).
  • --memrate-method โ€” specifies a memrate stress method. Lowkey some methods are only available to specific architectures or toolchains that support them ๐Ÿ‘€. The available memrate stress methods are described as follows:

okay so the memrate method menu is giving full buffet energy, bestie โ€” every single option is here:

Method โ†’ Description

  • all โ€” iterate over all the below memrate methods
  • read128nt โ€” read 128 bits per read using non-temporal load
  • read128pf โ€” read 128 bits per read using prefetching
  • read64pf โ€” read 64 bits per read using prefetching
  • read1024 โ€” read a vector of 1024 bits per read
  • read512 โ€” read a vector of 512 bits per read
  • read256 โ€” read a vector of 256 bits per read
  • read128 โ€” read 128 bits per read
  • read64 โ€” read 64 bits per read
  • read32 โ€” read 32 bits per read
  • read16 โ€” read 16 bits per read
  • read8 โ€” read 8 bits per read
  • write64stoq โ€” write 64 bits per write with x86 rep stoq
  • write32stow โ€” write 32 bits per write with x86 rep stow
  • write16stod โ€” write 16 bits per write with x86 rep stod
  • write8stob โ€” write 8 bits per write with x86 rep stob
  • write64ds โ€” write 64 bits per write with x86 movdiri
  • write128nt โ€” write 128 bits per write using non-temporal store
  • write64nt โ€” write 64 bits per write using non-temporal store
  • write32nt โ€” write 32 bits per write using non-temporal store
  • write1024 โ€” write a vector of 1024 bits per write
  • write512 โ€” write a vector of 512 bits per write
  • write256 โ€” write a vector of 256 bits per write
  • write128 โ€” write 128 bits per write
  • write64 โ€” write 64 bits per write
  • write32 โ€” write 32 bits per write
  • write16 โ€” write 16 bits per write
  • write8 โ€” write 8 bits per write
  • memset โ€” write using libc memset
  • --memrate-ops N โ€” stop after N bogo memrate operations. short and sweet, periodt.
  • --memrate-rd-mbs N โ€” specify the maximum allowed read rate in MB/sec. The actual read rate is dependent on scheduling jitter and memory accesses from other running processes. Setting this to zero will disable reads.
  • --memrate-wr-mbs N โ€” specify the maximum allowed read rate in MB/sec (yes, the page says โ€œread rateโ€ right here โ€” thatโ€™s the original wording, bestie). The actual write rate is dependent on scheduling jitter and memory accesses from other running processes. Setting this to zero will disable writes.

๐ŸŒช๏ธ Memory thrash stressor ๐ŸŒช๏ธ

  • --memthrash N โ€” start N workers that thrash and exercise a 16 MB buffer in various ways to try and trip thermal overrun. Each stressor will start 1 or more threads. The number of threads is chosen so that there will be at least 1 thread per CPU. Note that the optimal choice for N is a value that divides into the number of CPUs.
  • --memthrash-method method โ€” specify a memthrash stress method. Available memthrash stress methods are described as follows:

Method โ†’ Description

  • all โ€” iterate over all the below memthrash methods
  • chunk1 โ€” memset 1 byte chunks of random data into random locations
  • chunk8 โ€” memset 8 byte chunks of random data into random locations
  • chunk64 โ€” memset 64 byte chunks of random data into random locations
  • chunk256 โ€” memset 256 byte chunks of random data into random locations
  • chunkpage โ€” memset page size chunks of random data into random locations
  • copy128 โ€” copy 128 byte chunks from chunk N + 1 to chunk N with 128 bit memory accesses where possible.
  • copy128nt โ€” copy 128 byte chunks from chunk N + 1 to chunk N with non-temporal reads and writes with 128 bit memory accesses where possible.
  • flip โ€” flip (invert) all bits in random locations
  • flush โ€” flush cache line in random locations
  • lock โ€” lock randomly choosing locations (Intel x86 and ARM CPUs only)
  • matrix โ€” treat memory as a 2 ร— 2 matrix and swap random elements
  • memmove โ€” copy all the data in buffer to the next memory location
  • memset โ€” memset the memory with random data
  • memset64 โ€” memset the memory with a random 64 bit value in 64 byte chunks using non-temporal stores if possible or normal stores as a fallback
  • memsetstosd โ€” memset the memory using x86 32 bit rep stosd instruction (x86 only)
  • mfence โ€” stores with write serialization
  • numa โ€” memory bind pages across numa nodes
  • prefetch โ€” prefetch data at random memory locations
  • random โ€” randomly run any of the memthrash methods except for random and all
  • reverse โ€” swap 8 bit values from start to end and work towards the middle
  • spinread โ€” spin loop read the same random location 2โ†‘19 times
  • spinwrite โ€” spin loop write the same random location 2โ†‘19 times
  • swap โ€” step through memory swapping bytes in steps of 65 and 129 byte strides
  • swap64 โ€” work through memory swapping adjacent 64 byte chunks
  • swapfwdrev โ€” swap 64 bit values from start to end and work towards the middle and then from end to start and work towards the middle.
  • tlb โ€” work through memory in sub-optimal strides of prime multiples of the cache line size with reads and then writes to cause Translation Lookaside Buffer (TLB) misses.
  • --memthrash-ops N โ€” stop after N memthrash bogo operations.

๐Ÿงธ BSD mergesort stressor ๐Ÿงธ

  • --mergesort N โ€” start N workers that sort 32 bit integers using the BSD mergesort(3).
  • --mergesort-method [ mergesort-libc | mergesort-nonlibc ] โ€” select either the libc implementation of mergesort or an unoptimized implementation of mergesort. The default is the libc implementation if it is available.
  • --mergesort-ops N โ€” stop mergesort stress workers after N bogo mergesorts.
  • --mergesort-size N โ€” specify number of 32 bit integers to sort, default is 262144 (256 ร— 1024). math girlie moment, slay.

๐Ÿ—‚๏ธ File metadata mix ๐Ÿ—‚๏ธ

  • --metamix N โ€” start N workers that generate a file metadata mix of operations. Each stressor runs 16 concurrent processes that each exercise a fileโ€™s metadata with sequences of open, 256 lseeks and writes, fdatasync, close, fsync and then stat, open, 256 lseeks, reads, occasional file memory mapping, close, unlink and lstat. the chaotic little syscall parade of it all.
  • --metamix-bytes N โ€” set the size of metamix files, the default is 1 MB. One can specify the size as % of free space on the file system or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g.
  • --metamix-ops N โ€” stop the metamix stressor after N bogo metafile operations.

๐Ÿ  Resident memory (mincore) stressor ๐Ÿ 

  • --mincore N โ€” start N workers that walk through all of memory 1 page at a time checking if the page mapped and also is resident in memory using mincore(2). It also maps and unmaps a page to check if the page is mapped or not using mincore(2).
  • --mincore-ops N โ€” stop after N mincore bogo operations. One mincore bogo op is equivalent to a 300 mincore(2) calls.
  • --mincore-random โ€” instead of walking through pages sequentially, select pages at random. The chosen address is iterated over by shifting it right one place and checked by mincore until the address is less or equal to the page size.

๐Ÿ˜ด Minimum sleep time in nanosleep stressor ๐Ÿ˜ด

  • --min-nanosleep N โ€” start M workers that exercise nanosecond sleeps using powers of two nanosecond sleep delays. When all the instances have completed, the minimum, maximum and mean sleep times are reported for the sleep delays across all the min-nanosleep stressor instances. little sleep scientists, fr fr.
  • --min-nanosleep-ops N โ€” stop after N rounds of measurements across all the sleeps are completed.
  • --min-nanosleep-max N โ€” set the maximum nanosleep delay to use. If this is not a power of two then the previous power of two nanosecond delay time is used, e.g. specifying 10000 will select 8192 nanoseconds.
  • --min-nanosleep-sched [ batch | deadline | ext | fifo | idle | other | rr ] โ€” select scheduling policy. Note that deadline, fifo and rr require root privilege.
root privilege check, bestie: deadline, fifo and rr are not for just anyoneโ€™s little user account.

๐Ÿงš Misaligned read/write stressor ๐Ÿงš

  • --misaligned N โ€” start N workers that perform misaligned read and writes. By default, this will exercise 128 bit misaligned read and writes in 8 ร— 16 bits, 4 ร— 32 bits, 2 ร— 64 bits and 1 ร— 128 bits at the start of a page boundary, at the end of a page boundary and over a cache boundary. Misaligned read and writes operate at 1 byte offset from the natural alignment of the data type. On some architectures this can cause SIGBUS, SIGILL or SIGSEGV, these are handled and the misaligned stressor method causing the error is disabled. itโ€™s giving chaos with a safety net, no cap.
  • --misaligned-method method โ€” Available misaligned stress methods are described as follows:
  • all โ€” iterate over all the following misaligned methods (the whole lil squad)
  • int16rd โ€” 8 ร— 16 bit integer reads
  • int16wr โ€” 8 ร— 16 bit integer writes
  • int16inc โ€” 8 ร— 16 bit integer increments
  • int16atomic โ€” 8 ร— 16 bit atomic integer increments
  • int32rd โ€” 4 ร— 32 bit integer reads
  • int32wr โ€” 4 ร— 32 bit integer writes
  • int32wtnt โ€” 4 ร— 32 bit non-temporal stores (x86 only, bestie)
  • int32inc โ€” 4 ร— 32 bit integer increments
  • int32atomic โ€” 4 ร— 32 bit atomic integer increments
  • int64rd โ€” 2 ร— 64 bit integer reads
  • int64wr โ€” 2 ร— 64 bit integer writes
  • int64wrds โ€” 4 ร— 64 bit direct stores (x86 only)
  • int64wtnt โ€” 4 ร— 64 bit non-temporal stores (x86 only)
  • int64inc โ€” 2 ร— 64 bit integer increments
  • int64atomic โ€” 2 ร— 64 bit atomic integer increments
  • int128rd โ€” 1 ร— 128 bit integer reads
  • int128wr โ€” 1 ร— 128 bit integer writes
  • int128inc โ€” 1 ร— 128 bit integer increments
  • int128atomic โ€” 1 ร— 128 bit atomic integer increments
Heads up babes ๐ŸŒธ โ€” some of these options (128 bit integer and/or atomic operations) may not be available on some systems. So if one ghosts you, it's not you, it's the hardware.
  • --misaligned-ops N โ€” stop after N misaligned bogo operation. A misaligned bogo op is equivalent to 65536 ร— 128 bit reads or writes. That's the conversion rate, don't come for me ๐Ÿ’…

  • --mknod N โ€” start N workers that create and remove fifos, empty files and named sockets using mknod(2) and unlink(2).
  • --mknod-ops N โ€” stop directory thrash workers after N bogo mknod operations.

๐Ÿฆ‹ Memory mapped pages lock/unlock stressor ๐Ÿฆ‹

  • --mlock N โ€” start N workers that lock and unlock memory mapped pages using mlock(2), munlock(2), mlockall(2) and munlockall(2). Like okay, the way it does this is: it maps three contiguous pages and then locks the second page, hence ensuring non-contiguous pages are locked . This is then repeated until the maximum allowed mlocks or a maximum of 262144 mappings are made. Next, all future mappings are mlocked and the worker attempts to map 262144 pages, then all pages are munlocked and the pages are unmapped. Iconic behaviour honestly โœจ
  • --mlock-ops N โ€” stop after N mlock bogo operations.

๐Ÿ’œ Many child memory mapped page lock/unlock process stressor ๐Ÿ’œ

  • --mlockmany N โ€” start N workers that fork off a default of 1024 child processes in total; each child will attempt to anonymously mmap(2) and mlock(2) the maximum allowed mlockable memory size. The stress test attempts to avoid swapping by tracking low memory and swap allocations (but some swapping may occur โ€” fr fr, don't @ me). When either the maximum number of child processes is reached or all mlockable in-core memory is locked then child processes are killed and the stress test is repeated.
  • --mlockmany-ops N โ€” stop after N mlockmany (mmap and mlock) operations.
  • --mlockmany-procs N โ€” set the number of child processes to create per stressor. The default is to start a maximum of 1024 child processes in total across all the stressors. This option allows the setting of N child processes per stressor. You're so welcome ๐Ÿซถ

๐ŸŒˆ Memory mapping (mmap/munmap) stressor ๐ŸŒˆ

  • --mmap N โ€” start N workers continuously calling mmap(2)/munmap(2). The initial mapping is a large chunk (size specified by --mmap-bytes) followed by pseudo-random 4 K unmappings, then pseudo-random 4 K mappings, and then linear 4 K unmappings. Note that this can cause systems to trip the kernel OOM killer on Linux systems if not enough physical memory and swap is not available. Literally the main character of memory stressors and it WILL take you out ๐Ÿ’€ The MAP_POPULATE option is used to populate pages into memory on systems that support this. By default, anonymous mappings are used, however, the --mmap-file and --mmap-async options allow one to perform file based mappings if desired.

Note that since stress-ng 0.17.05 the --mmap-madvise, --mmap-mergeable, --mmap-mprotect, --mmap-slow-munmap and --mmap-write-check options should be used to enable the pre-0.17.05 mmap stressor behaviour. Okay so the old vibe is now a combo meal, got it ๐Ÿ“

  • --mmap-async โ€” enable file based memory mapping and use asynchronous msync'ing on each page, see --mmap-file.
  • --mmap-bytes N โ€” allocate N bytes in total for all the mmap stressor instances, the default is 256 MB. One can specify the size as % of total available memory or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g.
  • --mmap-file โ€” enable file based memory mapping and by default use synchronous msync'ing on each page.
  • --mmap-madvise โ€” enable randomized madvise(2) settings on pages.
  • --mmap-mergeable โ€” mark pages as mergeable via madvise(2) where possible.
  • --mmap-mlock โ€” attempt to mlock(2) mmap'd pages into memory causing more memory pressure by preventing pages from swapped out.
  • --mmap-mmap2 โ€” use mmap2(2) for 4 K page aligned offsets if mmap2 is available, otherwise fall back to mmap.
  • --mmap-mprotect โ€” change protection settings on each page of memory. Each time a page or a group of pages are mapped or remapped then this option will make the pages read-only, write-only, exec-only, and read-write. Four looks, one page, a whole fashion show ๐Ÿ’…
  • --mmap-numa โ€” assign memory mapped pages to randomly selected NUMA nodes. This is disabled for systems that do not support NUMA.
  • --mmap-odirect โ€” enable file based memory mapping and use O_DIRECT direct I/O.
  • --mmap-ops N โ€” stop mmap stress workers after N bogo operations.
  • --mmap-osync โ€” enable file based memory mapping and use O_SYNC synchronous I/O integrity completion.
  • --mmap-slow-munmap โ€” enable page-by-page memory unmapping rather than attempting to memory unmap contiguous pages in one large unmapping. This can cause lock contention when running with many concurrent mmap stressors and will slow down the stressor. Yes it's slow, that's literally the point, bestie ๐Ÿ™ˆ
  • --mmap-stressful โ€” enable --mmap-file, --mmap-madvise, --mmap-mergeable, --mmap-mlock, --mmap-mprotect, --mmap-odirect, --mmap-slow-munmap
  • --mmap-write-check โ€” write into each page a unique 64 bit check value for all pages and then read the value for a sanity check. This will force newly memory mapped pages to be faulted-in which slows down mmap bogo-op rate. This can also cause lock contention on page allocation and page unmapping on systems with many CPU threads and with cgroup memory accounting. Sanity check slay, but your bogo-op rate is gonna be crying ๐Ÿ˜ญ

โญ Random memory map/unmap stressor โญ

  • --mmapaddr N โ€” start N workers that memory map pages at a random memory location that is not already mapped. On 64 bit machines the random address is randomly chosen 32 bit or 64 bit address. If the mapping works a second page is memory mapped from the first mapped address. The stressor exercises mmap/munmap, mincore and segfault handling. Segfault handling?? The DRAMA ๐Ÿ”ฅ
  • --mmapaddr-mlock โ€” attempt to mlock(2) mmap'd pages into memory causing more memory pressure by preventing pages from swapped out.
  • --mmapaddr-ops N โ€” stop after N random address mmap bogo operations.

๐Ÿงš Memory map Copy-on-Write and unmap stressor ๐Ÿงš

  • --mmapcow N โ€” start N workers that exercise page allocation, modification (forcing copy-on-write) and page unmapping. Regions of memory from 1 page to the maximum mappable size are allocated. Each page in the regions are then modified, cache flushed (where possible) and unmapped. This stressor produces a high page fault rate. For each region mapped there are 6 different randomized strategies taken to exercise each page:
    • Sequential page modify and unmap
    • Sequential page modify and unmap (even pages, then odd pages)
    • Prime size page strides, page modify and unmap
    • Reverse sequential page modify and unmap
    • Reverse sequential page modify and unmap (even pages, then odd pages)
    • Single random page modify and unmap all pages
    • Randomly selected page modify and modify

(she says 6 and then lists seven, we simply do not question the queen ๐Ÿ‘‘)

  • --mmapcow-fork โ€” fork child process to exercise pages in parallel with parent to exercise page handling harder. Harder. Bestie said harder.
  • --mmapcow-free โ€” after each page is modified and before each page is unmapped use madvise(2) MADV_FREE (if it is available) to indicate the page is free
  • --mmapcow-mlock โ€” attempt to mlock(2) each modified page, this can increase the number of page faults. Only available with the mlock2 system call.
  • --mmapcow-numa โ€” assign memory mapped pages to randomly selected NUMA nodes. This is disabled for systems that do not support NUMA.
  • --mmapcow-ops N โ€” stop after N pages are modified and unmapped

๐Ÿซถ Forked memory map stressor ๐Ÿซถ

  • --mmapfork N โ€” start N workers that each fork off 32 child processes, each of which tries to allocate some of the free memory left in the system (and trying to avoid any swapping). The child processes then hint that the allocation will be needed with madvise(2) and then memset it to zero and hint that it is no longer needed with madvise before exiting. This produces significant amounts of VM activity, a lot of cache misses and with minimal swapping. VM activity AND minimal swapping? The balance, the range, the icon behaviour โœจ
  • --mmapfork-bytes N โ€” mmaps N bytes total, bestie, and that total gets split equally between all the forked child processes of all the workers ๐Ÿซถ default? half of the free memory, no cap. You can flex the size as a % of total available memory, or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g โœจ
  • --mmapfork-ops N โ€” stop after N mmapfork bogo operations, periodt ๐Ÿ’…
  • --mmapfork-procs N โ€” how many child processes per worker to fork. Range is 1 to 256, default is 32 ๐Ÿ‘‘

๐ŸŽ€ Memory map files stressor ๐ŸŽ€

  • --mmapfiles N โ€” start N workers that attempt to memory map and then unmap up to 512 ร— 1024 files into memory ๐Ÿ˜ญ it literally just traverses /lib, /lib32, /lib64, /boot, /bin, /etc, /sbin, /usr, /var, /sys and /proc and tries to memory map files in these directories. Heads up: the mapping bogo-ops rate will depend on the speed of access to files on these file systems ๐Ÿฆ‹
  • --mmapfiles-numa โ€” assign memory mapped pages to randomly selected NUMA nodes. Disabled for systems that do not support NUMA ๐Ÿ’œ
  • --mmapfiles-ops N โ€” stop after N memory map/unmap operations ๐ŸŒธ
  • --mmapfiles-populate โ€” default behaviour is to do a memory mapping and not fault any pages into physical memory. This option uses MAP_POPULATE when available and will also read the first byte in each page to ensure pages are faulted into memory, forcing memory population from file ๐Ÿ”ฅ
  • --mmapfiles-shared โ€” default is private memory mapped files, but with this option it'll use shared memory mappings โญ

๐Ÿฆ‹ Fixed address memory map stressor ๐Ÿฆ‹

  • --mmapfixed N โ€” start N workers that perform fixed address allocations from the top virtual address down to 128 K โœจ the allocated sizes go from 1 page to 8 pages, and various random mmap flags get used: MAP_SHARED/MAP_PRIVATE, MAP_LOCKED, MAP_NORESERVE, MAP_POPULATE. If it successfully map'd, then the allocation is remap'd โ€” first to a large range of addresses based on a random start, and finally to an address that's several pages higher in memory. Mappings and remappings are madvised with random madvise options to further exercise the mappings, iykyk ๐Ÿ’…
  • --mmapfixed-mlock โ€” attempt to mlock(2) mmap'd pages into memory, causing more memory pressure by preventing pages from being swapped out ๐Ÿ˜ค
  • --mmapfixed-numa โ€” assign memory mapped pages to randomly selected NUMA nodes. Disabled for systems that do not support NUMA ๐ŸŽ€
  • --mmapfixed-ops N โ€” stop after N mmapfixed memory mapping bogo operations ๐Ÿ’–

๐ŸŒˆ Huge page memory mapping stressor ๐ŸŒˆ

  • --mmaphuge N โ€” start N workers that attempt to mmap a set of huge pages and large huge-page-sized mappings. Successful mappings are madvised with MADV_NOHUGEPAGE and MADV_HUGEPAGE settings, and then 1/64th of the normal small page size pages are touched ๐Ÿ‘€ finally, an attempt to unmap a small page size page at the end of the mapping is made (these may fail on huge pages) before the set of pages are unmapped. By default 8192 mappings are attempted per round of mappings, or until swapping is detected ๐Ÿ“
  • --mmaphuge-file โ€” attempt to mmap on a 16 MB temporary file and random 4 K offsets. If this fails, anonymous mappings are used instead ๐Ÿงš
  • --mmaphuge-mlock โ€” attempt to mlock(2) mmap'd huge pages into memory, causing more memory pressure by preventing pages from being swapped out ๐Ÿ’€
  • --mmaphuge-mmaps N โ€” set the number of huge page mappings to attempt in each round of mappings. Default is 8192 mappings โœจ
  • --mmaphuge-numa โ€” assign memory mapped pages to randomly selected NUMA nodes. Disabled for systems that do not support NUMA ๐Ÿ’œ
  • --mmaphuge-ops N โ€” stop after N mmaphuge bogo operations ๐Ÿ”ฅ

๐Ÿ’… Maximum memory mapping per process stressor ๐Ÿ’…

  • --mmapmany N โ€” start N workers that attempt to create the maximum allowed per-process memory mappings ๐Ÿ˜ณ the way it does this: map 3 contiguous pages, then unmap the middle page (which splits the mapping into two), and repeat until the maximum allowed mappings are made. Iconic honestly.
  • --mmapmany-mappings N โ€” specify maximum number of memory mappings to attempt per map()/munmap() cycle ๐ŸŽ€
  • --mmapmany-mlock โ€” attempt to mlock(2) mmap'd huge pages into memory, causing more memory pressure by preventing pages from being swapped out ๐Ÿซถ
  • --mmapmany-numa โ€” assign memory mapped pages to randomly selected NUMA nodes. Disabled for systems that do not support NUMA ๐ŸŒธ
  • --mmapmany-ops N โ€” stop after N mmapmany bogo operations โญ

๐Ÿ‘‘ Memory map random mapping operations ๐Ÿ‘‘

  • --mmaprandom N โ€” start N workers that exercise a random mix of memory-map-related system calls on randomly sized mappings ๐ŸŒˆ the mappings are either anonymous mapped or file mapped (on a small file or on a memfd file where available). This exercises mmap(2) (random options and flags), munmap(2), mlock(2), munlock(2), madvise(2), posix_madvise(3), mincore(2), mremap(2), msync(2), mprotect(2), remap_file_pages(2), memory read, memory write and cache flushing ๐Ÿ˜ญ where possible, randomized options are used to generate a mix of mostly valid (and some invalid) memory mapping operations. Metrics are reported for all successful system calls and memory operations, no cap ๐Ÿ’ฏ
  • --mmaprandom-ops N โ€” stop after N random memory mapping bogo-operations. Generally, 1 bogo-op is one memory related system call (except for read/write/cache operations) ๐Ÿฆ‹
  • --mmaprandom-mappings N โ€” select maximum number of memory mappings, default is 1024, range 1 to 65536 ๐Ÿ’œ
  • --mmaprandom-maxpages N โ€” select maximum number of pages to be memory mapped, default is 8, range 2 to 1024. The pages mapped are randomly chosen from 1 to maxpages โœจ
  • --mmaprandom-numa โ€” assign randomly chosen memory mapped pages to randomly selected NUMA nodes. Disabled for systems that do not support NUMA ๐ŸŽ€

๐Ÿ’€ Memory map torture stressor ๐Ÿ’€

  • --mmaptorture N โ€” start N workers that exercise memory mapping operations on a shared file ๐Ÿ”ฅ mappings of various random sizes are tortured with calls to madvise(2), mremap(2), mprotect(2), msync(2), mlock(2), munlock(2), mseal(2) and mincore(2) while the underlying file is modified by writes, truncation and hole punching ๐Ÿ˜ณ mapped data is read and written and sync'd back to file. For NUMA systems, pages are randomly placed across NUMA nodes. All this activity causes cache misses, exercises the TLB and causes IPI interrupts between CPUs โ€” it's giving chaos, but make it scientific ๐Ÿ’…
  • --mmaptorture-bytes N โ€” allocate N bytes in total for all the mmaptorture stressor instances, default is 256 MB ๐Ÿซถ you can specify the size as a % of total available memory or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g โœจ
  • --mmaptorture-msync N โ€” memory mapped pages are msync'd various times per bogo-operation, and this option specifies the percentage amount of the pages per msync operation that are msync'd. Default is 10%. Specifying zero will disable msync'ing ๐Ÿ™ˆ
  • --mmaptorture-ops N โ€” stop after N iterations of memory mapping torture operations ๐ŸŒธ

๐Ÿงš Kernel module loading stressor (Linux) ๐Ÿงš

  • --module N โ€” start N workers that use finit_module() to load the module specified, or the hello test module if it is available ๐Ÿ‘‘ there are different ways to test loading modules: using modprobe calls in a loop, using the kernel module autoloader, and this stress-ng module stressor. To stress-test modprobe we can simply run the userspace modprobe program in a loop. To stress-test the kernel module autoloader we can stress-test using the upstream kernel tools/testing/selftests/kmod/kmod.sh. That ends up calling modprobe in the end, and it has its own caps built-in to self-protect the kernel from too many requests at the same time. The userspace modprobe call will also prevent calls if the same module exists already. The stress-ng modules stressor is designed to help stress-test the finit_module() system call even if the module is already loaded, testing races that are otherwise hard to reproduce ๐Ÿ”ฅ
  • --module-name NAME โ€” NAME of the module to use, for example: test_module, xfs, ext4 โœจ by default test_module is used so CONFIG_TEST_LKM must be enabled in the kernel. The module dependencies must be loaded prior to running these stressor tests, as this stresses running finit_module() not using modprobe ๐Ÿ’œ
  • --module-no-modver โ€” ignore module modversions when using finit_module() ๐ŸŽ€
  • --module-no-vermag โ€” ignore module versions when using finit_module() ๐Ÿฆ‹
  • --module-no-unload โ€” do not unload the module right after loading it with finit_module() โญ
  • --module-ops N โ€” stop after N module load/unload cycles ๐Ÿ’…

๐Ÿ“ Monte Carlo computations of ฯ€ and e and various integrals stressor ๐Ÿ“

  • --monte-carlo N โ€” start N stressors that compute ฯ€ and e (Euler's number) using Monte Carlo computational experiments with various random number generators ๐ŸŒˆ math girlie behaviour, honestly iconic ๐Ÿ˜ญ
  • --monte-carlo-method [ all | e | exp | pi | sin | sqrt | squircle ] โ€” specify the computation to perform, options are as follows:

โ€ฆand the method menu for it is chef's kiss, bestie:

  • all โ€” use all monte carlo computation methods
  • e โ€” compute Euler's constant e
  • exp โ€” integrate exp(x โ†‘ 2) for x = 0..1
  • pi โ€” compute ฯ€ from the area of a circle
  • sin โ€” integrate sin(x) for x = 0..ฯ€
  • sqrt โ€” integrate sqrt(1 + x โ†‘ 4) for x = 0..1
  • squircle โ€” area of a unit squircle x โ†‘ 4 + y โ†‘ 4 = 1
  • --monte-carlo-ops N โ€” stop after N Monte Carlo computation experiments ๐Ÿ’…
  • --monte-carlo-rand [ all | drand48 | getrandom | lcg | pcg32 | mwc64 | random | xorshift ] โ€” pick which random number generator gets to do the honours, and the lineup is:
    • all โ€” use all the random number generators
    • arc4 โ€” use the libc cryptographically-secure pseudorandom arc4random(3) number generator.
    • drand48 โ€” use the libc linear congruential algorithm drand48(3) using 48-bit integer arithmetic.
    • getrandom โ€” use the getrandom(2) system call for random values.
    • lcg โ€” use a 32 bit Paker-Miller Linear Congruential Generator, with a division optimization.
    • pcg32 โ€” use a 32 bit O'Neill Permuted Congruential Generator.
    • mwc64 โ€” use the 64 bit stress-ng Multiply With Carry random number generator.
    • random โ€” use the libc random(3) Non-linear Additive Feedback random number generator.
    • xorshift โ€” use a 32 bit Marsaglia shift-register random number generator.
  • --monte-carlo-samples N โ€” how many random number samples to throw at computing ฯ€ or e, default is 100000. ๐ŸŽฒ

๐Ÿงฎ Multi-precision floating operations (mpfr) stressor

  • --mpfr N โ€” start N workers that exercise multi-precision floating point operations using the GNU Multi-Precision Floating Point Reliable library (mpfr). The operations it computes are, like, so fancy:
    • apery โ€” calculate Apery's constant ฮถ(3); the sum of 1/(n โ†‘ 3).
    • cosine โ€” compute cos(ฮธ) for ฮธ = 0 to 2ฯ€ in 100 steps.
    • euler โ€” compute e using n = (1 + (1 รท n)) โ†‘ n.
    • exp โ€” compute 1000 exponentials.
    • log โ€” compute 1000 natural logarithms.
    • omega โ€” compute the omega constant defined by ฮฉeโ†‘ฮฉ = 1 using efficient iteration of ฮฉn+1 = (1 + ฮฉn) / (1 + eโ†‘ฮฉn).
    • phi โ€” compute the Golden Ratio ฯ• using series.
    • sine โ€” compute sin(ฮธ) for ฮธ = 0 to 2ฯ€ in 100 steps.
    • nsqrt โ€” compute square root using Newton-Raphson.
  • --mpfr-ops N โ€” stop workers after N iterations of various multi-precision floating point operations.
  • --mpfr-precision N โ€” specify the precision in binary digits of the floating point operations. Default is 1000 bits, and the allowed range is 32 to 1000000 โ€” and yes, the high end is very slow ๐Ÿ’€ you've been warned.

๐Ÿ›ก๏ธ Memory protection stressor

  • --mprotect N โ€” start N workers that exercise changing page protection settings and accessing memory after each change. 8 processes per worker contend with each other changing page protection settings on a shared memory region of just a few pages to cause TLB flushes. A read and write to the pages can cause segmentation faults and these are handled by the stressor. All combinations of page protection settings are exercised, including invalid combinations โ€” chaotic, but make it functional โœจ
  • --mprotect-ops N โ€” stop after N mprotect calls.

๐Ÿ“ฌ POSIX message queue stressor (Linux)

  • --mq N โ€” start N sender and receiver processes that continually send and receive messages using POSIX message queues. (Linux only, bestie ๐Ÿง)
  • --mq-ops N โ€” stop after N bogo POSIX message send operations completed.
  • --mq-size N โ€” specify size of POSIX message queue. Default size is 10 messages, and on most Linux systems that's literally the maximum allowed size for normal users. If the size you ask for is greater than the allowed message queue size then a warning is issued and the maximum allowed size is used instead. so dramatic, but okay ๐Ÿซถ

๐Ÿ” Memory remap stressor (Linux)

  • --mremap N โ€” start N workers continuously calling mmap(2), mremap(2) and munmap(2). The initial anonymous mapping is a large chunk (size specified by --mremap-bytes) and then iteratively halved in size by remapping all the way down to a page size and then back up to the original size. This worker is only available for Linux.
  • --mremap-bytes N โ€” initially allocate N bytes per remap stress worker, default is 256 MB. You can specify the size in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g.
  • --mremap-mlock โ€” attempt to mlock(2) remap'd pages into memory, causing more memory pressure by preventing pages from being swapped out.
  • --mremap-numa โ€” assign memory mapped pages to randomly selected NUMA nodes. This is disabled for systems that do not support NUMA.
  • --mremap-ops N โ€” stop mremap stress workers after N bogo operations.

๐Ÿ”’ Memory Sealing

  • --mseal N โ€” start N memory sealing stressors that exercise madvise(2), mremap(2), mprotect(2) and mseal(2) operations on two pages of memory mapped anonymous private memory. Linux 6.10+ kernels only โ€” no vintage vibes allowed ๐Ÿ’…
  • --mseal-ops N โ€” stop after N msealed memory operations.

๐Ÿ“จ System V message IPC stressor

  • --msg N โ€” start N sender and receiver processes that continually send and receive messages using System V message IPC.
  • --msg-bytes N โ€” specify the size of the message being sent and received. Range 4 to 8192 bytes, default is 4 bytes.
  • --msg-ops N โ€” stop after N bogo message send operations completed.
  • --msg-types N โ€” select the quality of message types (mtype) to use. By default, msgsnd sends messages with a mtype of 1; this option lets you send messages types in the range 1..N to exercise the message queue receive ordering. Heads up: this will also impact throughput performance. ๐Ÿซ 

๐Ÿ”„ Synchronize file with memory map (msync) stressor

  • --msync N โ€” start N stressors that msync data from a file backed memory mapping from memory back to the file, and msync modified data from the file back to the mapped memory. This exercises the msync(2) MS_SYNC and MS_INVALIDATE sync operations.
  • --msync-bytes N โ€” allocate N bytes for the memory mapped file, default is 256 MB. You can specify the size as % of total available memory, or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g.
  • --msync-ops N โ€” stop after N msync bogo operations completed.

๐Ÿชž Synchronize file with memory map (msync) coherency stressor

  • --msyncmany N โ€” start N stressors that memory map up to 32768 pages on the same page of a temporary file, change the first 32 bits in a page and msync the data back to the file. The other 32767 pages are examined to see if the 32 bit check value is msync'd back to these pages. detective mode: activated ๐Ÿ•ต๏ธโ€โ™€๏ธ
  • --msyncmany-ops N โ€” stop after N msync calls in the msyncmany stressors are completed.

๐Ÿงต ISO C mtx (mutex) stressor

  • --mtx N โ€” start N stressors that exercise ISO C mutex locking and unlocking.
  • --mtx-ops N โ€” stop after N bogo mutex lock/unlock operations.
  • --mtx-procs N โ€” by default 2 threads are used for locking/unlocking on a single mutex. This option lets you change that default to 2 to 64 concurrent threads.

๐Ÿ—บ๏ธ Unmapping shared non-executable memory stressor (Linux)

  • --munmap N โ€” start N stressors that exercise unmapping of shared non-executable mapped regions of child processes (Linux only). The unmappings map shared memory regions page by page with a prime sized stride that creates many temporary mapping holes. When the unmappings are complete the child will exit and a new one is started.
โš ๏ธ Note that this may trigger segmentation faults in the child process โ€” these are handled where possible by forcing the child process to call _exit(2). not me watching the children crash on purpose ๐Ÿ˜ญ
  • --munmap-ops N โ€” stop after N page unmappings.

๐Ÿ” Pthread mutex stressor

  • --mutex N โ€” start N stressors that exercise pthread mutex locking and unlocking. If run with enough privilege then the FIFO scheduler is used and a random priority between 0 and 80% of the maximum FIFO priority level is selected for the locking operation. The minimum FIFO priority level is selected for the critical mutex section and unlocking operation to exercise random inverted priority scheduling. scheduling chaos, but make it intentional ๐Ÿ’œ
  • --mutex-affinity โ€” enable random CPU affinity changing between mutex lock and unlock.
  • --mutex-ops N โ€” stop after N bogo mutex lock/unlock operations.
  • --mutex-procs N โ€” by default 2 threads are used for locking/unlocking on a single mutex. This option lets you change that default to 2 to 64 concurrent threads.

โฐ High resolution and scheduler stressor via nanosleep calls

  • --nanosleep N โ€” start N workers that each run pthreads that call nanosleep(2) with random delays from 1 to 2โ†‘18 nanoseconds. This should exercise the high resolution timers and scheduler. tiny little sleeps, huge little vibes ๐Ÿ˜ด
  • --nanosleep-method [ all | cstate | random | ns | us | ms ] โ€” select the nanosleep sleep duration method. By default, cstate residency durations (if they exist) and random durations are used. This option lets you select one of the three methods:
  • all โ€” uses cstate and random nanosecond durations together, a lil' best-of-both-worlds situation ๐Ÿ’…
  • cstate โ€” uses cstate nanosecond durations. Highly recommend pairing this with --nanosleep-threads 1 so you're exercising fewer concurrent nanosleeps and letting the CPUs actually drop into those deep C states ๐Ÿ˜ดโœจ
  • random โ€” uses random nanosecond durations between 1 and 2โ†‘18 nanoseconds ๐ŸŽฒ
  • ns โ€” uses 1ns (nanosecond) nanosleeps
  • us โ€” uses 1ฮผs (microsecond) nanosleeps
  • ms โ€” uses 1ms (millisecond) nanosleeps
  • --nanosleep-ops N โ€” stop the nanosleep stressor after N bogo nanosleep operations.
  • --nanosleep-threads N โ€” specifies how many concurrent pthreads run per stressor. Default is 8, allowed range is 1 to 1024. ๐Ÿ‘‘

  • --netdev N โ€” start N workers that go absolutely feral on the various netdevice ioctl(2) commands across all the available network devices. The exact ioctls getting exercised are: SIOCGIFCONF, SIOCGIFINDEX, SIOCGIFNAME, SIOCGIFFLAGS, SIOCGIFADDR, SIOCGIFNETMASK, SIOCGIFMETRIC, SIOCGIFMTU, SIOCGIFHWADDR, SIOCGIFMAP and SIOCGIFTXQLEN. See netdevice(7) for more deets on these ioctl commands ๐Ÿ‘€
  • --netdev-ops N โ€” stop after N netdev bogo operations are completed.

  • --netlink-proc N โ€” start N workers that spawn child processes and monitor fork/exec/exit process events via the proc netlink connector. Every event received counts as one bogo op ๐ŸŽ€ This stressor can only run on Linux and needs CAP_NET_ADMIN capability, no cap ๐Ÿงข
  • --netlink-proc-ops N โ€” stop the proc netlink connector stressors after N bogo ops.

  • --netlink-task N โ€” start N workers that collect task statistics via the netlink taskstats interface. Again: Linux only, and it requires CAP_NET_ADMIN capability ๐Ÿ”
  • --netlink-task-ops N โ€” stop the taskstats netlink connector stressors after N bogo ops.

๐Ÿ˜‡ Nice stressor

  • --nice N โ€” start N CPU-consuming workers that exercise the available nice levels. Each iteration forks off a child process that runs through all the nice levels, running a busy loop for 0.1 seconds per level, and then exits. It's giving "polite but make it stressful" ๐Ÿซถ
  • --nice-ops N โ€” stop after N nice bogo nice loops.

๐Ÿšซ NO-OP CPU instruction stressor

  • --nop N โ€” start N workers that consume CPU cycles issuing no-op instructions. This stressor is available if the assembler supports the "nop" instruction โœจ
  • --nop-instr INSTR โ€” use an alternative nop instruction INSTR.

For x86 CPUs, INSTR can be one of nop, pause, nop2 (2 byte nop) through to nop15 (15 byte nop) and fnop.

For ARM CPUs, INSTR can be one of nop or yield.

For PPC64 CPUs, INSTR can be one of nop, mdoio, mdoom or yield.

For S390 CPUs, INSTR can be one of nop or nopr.

For other processors, INSTR is only nop.

The random INSTR option selects a random mix of the available nop instructions. If the chosen INSTR generates an SIGILL signal, then the stressor falls back to the vanilla nop instruction ๐Ÿ’€ (good save ngl)

  • --nop-ops N โ€” stop nop workers after N no-op bogo operations. Each bogo-operation is equivalent to 256 loops of 256 no-op instructions. Math girlies rise ๐Ÿ™ˆ

๐Ÿ•ณ๏ธ /dev/null stressor

  • --null N โ€” start N workers that exercise /dev/null with write(2), lseek(2), ioctl(2), fcntl(2), fallocate(2) and fdatasync(2) calls. If you just want /dev/null write benchmarking, use the --null-write option instead ๐ŸŽ€
  • --null-ops N โ€” stop null stress workers after N /dev/null bogo operations.
  • --null-write โ€” just write to /dev/null with 4 K writes, with no additional exercising on /dev/null. Pure, unfiltered, no thoughts head empty ๐Ÿ’–

๐Ÿง  Migrate memory pages over NUMA nodes stressor

  • --numa N โ€” start N workers that migrate stressors and a 4 MB memory mapped buffer around all the available NUMA nodes. This uses migrate_pages(2) to move the stressors, and mbind(2) and move_pages(2) to move the pages of the mapped buffer. After each move, the buffer is written to force activity over the bus, which results in cache misses ๐Ÿ”ฅ Heads up: this test will only run on hardware with NUMA enabled.
  • --numa-bytes N โ€” specify the total number of bytes to be exercised by all the workers; the given size is divided by the number of workers and rounded to the nearest page size. Default is 4 MB per worker. You can give the size as a % of total available memory, or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g ๐Ÿ’…
  • --numa-ops N โ€” stop NUMA stress workers after N bogo NUMA operations.
  • --numa-shuffle-addr โ€” shuffle page order for the address list when calling move_pages(2) ๐ŸŒ€
  • --numa-shuffle-node โ€” shuffle node order for the address list when calling move_pages(2) ๐ŸŒ€

๐Ÿ“ฆ NUMA page copying stressor

  • --numacopy N โ€” start N workers that iterate over each NUMA node, copying a local page of data to and from all the other NUMA nodes. The number of pages copied for each combination of node-to-node copy is output at the end of the run. Local node copies should be faster than the distant node copies ๐Ÿ‘€ The stressor exercises the NUMA node memory bus interconnect, respectfully.
  • --numacopy-affinity [ next | none | node | prev | random ] โ€” select the CPU affinity of the copying process relative to the NODE where data is being copied from. This occurs 20 times per second. Options described below โฌ‡๏ธ
    • next โ€” move process to a CPU associated with the next NUMA node. If there is no next node, use random CPU selection.
    • none โ€” no process moving (default option) ๐Ÿ˜Œ
    • node โ€” move process to a CPU associated with the source NODE.
    • prev โ€” move process to a CPU associated with the previous NUMA node. If there is no previous node, use random CPU selection.
    • random โ€” move process to any random CPU ๐ŸŽฒ
  • --numacopy-mode [ bind | interleave | preferred | weighted-interleave ] โ€” select mbind mode options; see mbind(2) for an explanation of these modes ๐Ÿ“š
  • --numacopy-ops N โ€” stop after N NUMA copy bogo-operations. One bogo operation is 100 copies of pages to/from every node to every node. That's a lot of copying bestie ๐Ÿ˜ญ

๐Ÿช  Large pipe stressor

  • --oom-pipe N โ€” start N workers that create as many pipes as allowed and exercise expanding and shrinking the pipes from the largest pipe size down to a page size. Data is written into the pipes and read out again to fill the pipe buffers. With --aggressive mode enabled, the data is not read out when the pipes are shrunk, causing the kernel to OOM processes aggressively ๐Ÿ’€ Running many instances of this stressor will force the kernel to OOM processes due to the many large pipe buffer allocations. Fr fr, dangerous territory.
  • --oom-pipe-ops N โ€” stop after N bogo pipe expand/shrink operations.

โ˜ ๏ธ Illegal instructions stressors

  • --opcode N โ€” start N workers that fork off children which execute randomly generated executable code. This will generate issues such as illegal instructions, bus errors, segmentation faults, traps and floating point errors โ€” all of which are handled gracefully by the stressor ๐Ÿงšโ€โ™€๏ธ iconic behaviour honestly
  • --opcode-method [ inc | mixed | random | text ] โ€” select the opcode generation method. By default, random bytes are used to generate the executable code. This option lets you pick one of three methods:
    • inc โ€” use incrementing 32 bit opcode patterns from 0x00000000 to 0xfffffff inclusive.
    • mixed โ€” use a mix of incrementing 32 bit opcode patterns and random 32 bit opcode patterns that are also inverted, encoded with gray encoding and bit reversed ๐Ÿ”„
    • random โ€” generate opcodes using random bytes from a mwc random generator.
    • text โ€” copies random chunks of code from the stress-ng text segment and randomly flips single bits in a random choice of 1/8th of the code.
  • --opcode-ops N โ€” stop after N attempts to execute illegal code.

๐Ÿ“‚ Opening file (open) stressor

  • -o N, --open N โ€” start N workers that perform open(2) and then close(2) operations on /dev/zero. The maximum opens at one time is system defined, so the test will run up to this maximum, or 65536 open file descriptors โ€” whichever comes first ๐Ÿ
  • --open-fd โ€” run a child process that scans /proc/$PID/fd and attempts to open the files that the stressor has opened. This exercises racing open/close operations on the proc interface ๐ŸŽ๏ธ
  • --open-max N โ€” try to open a maximum of N files (or up to the maximum per-process open file system limit). The value can be the number of files, or a percentage of the maximum per-process open file system limit ๐Ÿ’…
  • --open-ops N โ€” stop the open stress workers after N bogo open operations.

๐Ÿ’… OpenVPN DCO kernel driver stressor (Linux)

  • --ovpn N โ€” spin up N workers that absolutely bully the in-kernel OpenVPN data channel offload (ovpn) driver through its generic netlink API. Each worker makes an ovpn network interface and then just goes to town on it with a random mix of netlink commands: new peer, set peer, get peer, delete peer, new key, delete key, get key, swap keys, and connect. Keys are generated at runtime with getrandom(2). Every successfully completed command loop = one bogo op. Heads up bestie: this stressor needs the ovpn kernel module loaded, libnl-3 present at build time, and the CAP_NET_ADMIN capability. No skips. โœจ
  • --ovpn-ops N โ€” stop the ovpn stressors after N bogo ops.
  • --ovpn-tunnel โ€” ok so instead of fuzzing the control plane, this one builds a real two-endpoint DCO tunnel ๐Ÿซถ. Each worker grabs a private network namespace and, inside it, creates two more network namespaces hooked together by a veth pair (that's the transport underlay โ€” UDP or TCP, and IPv4 or IPv6, chosen at random each cycle) and sets up an ovpn interface with a fixed shared key at each end. And the vibe check: no interface is ever added to the host network namespace. It then keeps the tunnel alive for a random period, mixing data-path traffic (the client injects packets so the kernel encrypts and decrypts them) with control-plane churn (the server creates, swaps and deletes peers and keys), then tears the whole tunnel down and rebuilds it โ€” so the data path, the control plane and the teardown races all get exercised. ๐Ÿ”ฅ

Traffic gets reported on all three axes a cycle varies over, as "MB per sec encrypted, UDP transport, IPv4" plus the seven other combinations, taken straight from the kernel's own per-peer byte counters โ€” not estimated in userspace, thank u very much โ€” and reported as a rate so runs with different worker counts and timeouts stay comparable. Requires the ovpn kernel module plus CAP_SYS_ADMIN and CAP_NET_ADMIN; the stressor is skipped if no tunnel can be built. ๐Ÿ’€


๐ŸŽ€ Page table and TLB stressor

  • --pagemove N โ€” start N workers that mmap a memory region (default 4 MB) and then shuffle pages to the virtual address of the previous page. Each page shuffle uses 3 mremap operations to move a page. This is the page table and Translation Lookaside Buffer (TLB) flushing workout, basically. ๐Ÿ˜ญ
  • --pagemove-bytes N โ€” specify the size of the memory mapped region to be exercised. You can give it as % of total available memory, or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g. ๐Ÿฆ‹
  • --pagemove-mlock โ€” attempt to mlock(2) the mmap'd and mremap'd pages into memory, which causes more memory pressure by stopping pages from being swapped out. Iconic, chaotic, love that for us.
  • --pagemove-numa โ€” assign memory mapped pages to randomly selected NUMA nodes. This is disabled for systems that don't support NUMA. ๐Ÿงš
  • --pagemove-ops N โ€” stop after N pagemove shuffling operations, where shuffling all the pages in the mmap'd region counts as 1 bogo-operation.

๐ŸŒธ Page scattered mappings

  • --pagescatter N โ€” start N workers that exercise memory mapping of batches of single pages at randomly chosen addresses. Where possible, the MAP_FIXED_NOREPLACE or MAP_FIXED mmap(2) flags are used to try and mmap pages at fixed addresses across the address space; failing that, a hinted address is used without these flags. Pages are then written, read, set to PROT_NONE via mprotect(2) and then unmapped. This exercises page table traversal, the Translation Lookaside Buffer (TLB) and general page handling. The rate of these operations is also reported for the first stressor instance across the range of batches of single mappings. โœจ
  • --pagescatter-numa โ€” assign memory mapped pages to NUMA nodes using a round-robin node selection. Disabled for systems that don't support NUMA.
  • --pagescatter-ops N โ€” stop after N bogo page mmapping operations.
  • --pagescatter-order N โ€” attempt to map and use 2โ†‘N maximum number of pages. This can be reduced to a lower value by the stressor if there aren't enough free pages for all the pagescatter instances. ๐Ÿ™ˆ
  • --pagescatter-populate โ€” populate pages when they are memory paged rather than using copy-on-write page allocation when pages are written to.

๐Ÿฆ‹ Memory page swapping stressor

  • --pageswap N โ€” start N workers that exercise page swap in and swap out. Pages are allocated and paged out using madvise(2) MADV_PAGEOUT. When the maximum per-process number of mmaps is reached, or 65536 pages are allocated, the pages are read to page them back in and unmapped in reverse mapping order. Full circle moment. ๐Ÿ’ซ
  • --pageswap-ops N โ€” stop after N page allocation bogo operations.
  • --pageswap-pages N โ€” specify the maximum number of pages to be mmap'd per instance; range 1 to 1048576. The default is 65536 pages.

๐Ÿ’ป PCI sysfs stressor (Linux)

  • --pci N โ€” exercise PCI sysfs by running N workers that read data (and mmap/unmap PCI config or PCI resource files). Linux only, bestie. Running as root will allow config and resource mmappings to be read and exercises PCI I/O mapping. ๐Ÿ‘‘
  • --pci-dev xxxx:xx:xx.x โ€” specify a PCI device to exercise instead of exercising all PCI devices. The device is specified using the PCI device name xxxx:xx:xx.x where x is a hexadecimal digit.
  • --pci-ops N โ€” stop pci stress workers after N PCI subdirectory exercising operations.
  • --pci-ops-rate N โ€” specify the PCI bogo-ops per second rate. This is useful for PCI bandwidth limiting and, on x86 systems, it may reduce uncore transactions. ๐Ÿ”ฅ

๐Ÿ’… Personality stressor

  • --personality N โ€” start N workers that attempt to set personality and get all the available personality types (process execution domain types) via the personality(2) system call. (Linux only.)
  • --personality-ops N โ€” stop personality stress workers after N bogo personality operations.

๐ŸŽ€ Mutex using Peterson algorithm stressor

  • --peterson N โ€” start N workers that exercise mutex exclusion between two processes using shared memory with the Peterson Algorithm. Where possible this uses memory fencing and falls back to using GCC __sync_synchronize if that's not available. The stressors contain simple mutex and memory coherency sanity checks. Ngl, kind of a flex. ๐Ÿซถ
  • --peterson-ops N โ€” stop peterson workers after N mutex operations.

โญ Page mmap stressor

  • --physpage N โ€” start N workers that use /proc/self/pagemap and /proc/kpagecount to determine the physical page and page count of a virtual mapped page and a page that is shared among all the stressors. Linux only, and it requires the CAP_SYS_ADMIN capability. ๐Ÿ’€
  • --physpage-mtrr โ€” enable setting various memory type range register (MTRR) types on physical pages (Linux and x86 only).
  • --physpage-ops N โ€” stop physpage stress workers after N bogo physical address lookups.

๐ŸŒˆ Physical page mmap stressor (using /dev/mem)

  • --physmmap N โ€” start N workers that try to mmap available System RAM (as specified by /proc/iomem) using /dev/mem and randomized private or shared pages. This requires CAP_SYS_ADMIN capabilities to fully read /proc/iomem and mmap onto /dev/mem.
Fr fr: systems may be fully locked down, and mmapping onto /dev/mem can be straight-up impossible. Not a bug, just the vibe. ๐Ÿ˜ญ
  • --physmmap-ops N โ€” stop physmmap stress workers after N bogo mmap attempts.
  • --physmmap-read โ€” perform 64 bit reads of all the data in each mmap'd page.

๐Ÿฆ‹ Process signals (pidfd_send_signal) stressor

  • --pidfd N โ€” start N workers that exercise signal sending via the pidfd_send_signal(2) system call. This stressor creates child processes and checks if they exist and can be stopped, restarted and killed using the pidfd_send_signal(2) system call. Main character energy for real. ๐Ÿ‘‘
  • --pidfd-ops N โ€” stop pidfd stress workers after N child processes have been created, tested and killed with pidfd_send_signal.

๐Ÿ“ Localhost ICMP (ping) stressor

  • --ping-sock N โ€” start N workers that send small randomized ICMP messages to the localhost across a range of ports (1024..65535) using a "ping" socket with an AF_INET domain, a SOCK_DGRAM socket type and an IPPROTO_ICMP protocol. Pinging urself, honestly iconic. ๐Ÿ’…
  • --ping-sock-ops N โ€” stop the ping-sock stress workers after N ICMP messages are sent.
  • --ping-sock-max-size N โ€” specify the maximum data size in bytes, with the range 9 to 65515 and the default as 12.

๐Ÿ’œ Pin memory stressor

  • --pinmem N โ€” force low memory by allocating and pinning anonymously mapped memory. The intent is to exercise long-term page pinning to force out-of-memory (OOM killer) conditions. For allocations larger than RLIMIT_MEMLOCK, root privilege is required. The default operation is to allocate, pin memory and repeatedly touch mapped pages with a unique per-page value (to stop kernel same page merging). ๐Ÿซถ
  • --pinmem-bytes N โ€” specify the size of memory to be allocated and pinned; this is divided up evenly among the number of pinmem stressors. The default is the total available memory. You can specify the size as % of total available memory, or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g. ๐ŸŒธ
  • --pinmem-cycle โ€” this one's a loop-de-loop, bestie: it keeps cycling through pinning and unpinning over and over until the stressor finally terminates ๐Ÿ’ซ
  • --pinmem-method [ all | io-uring | madvise | mlock ] โ€” picks how you wanna pin memory. The default is using io-uring to register the mapped memory with IORING_REGISTER_BUFFERS. The madvise method uses madvise(2) MADV_POPULATE_WRITE to enfore pages to be populated. The mlock method uses mlock(2) to lock pages. And all uses all the three methods (if available). Iconic little menu, ngl ๐ŸŽ€
  • --pinmem-ops N โ€” stop after N memory pin/unpin operations, periodt.

๐ŸŒŠ Large pipe stressor

  • -p N, --pipe N โ€” start N workers that perform large pipe writes and reads to exercise pipe I/O. This exercises memory write and reads as well as context switching. Heads up: each worker has two processes โ€” a reader and a writer ๐Ÿ‘€
  • --pipe-data-size N โ€” specifies the size in bytes of each write to the pipe (range from 4 bytes to 4096 bytes). Setting a small data size will cause more writes to be buffered in the pipe, hence reducing the context switch rate between the pipe writer and pipe reader processes. The default size is the page size. Cute and tiny = fewer switches, who knew ๐Ÿฆ‹
  • --pipe-ops N โ€” stop pipe stress workers after N bogo pipe write operations.
  • --pipe-readers N โ€” specify number of child reader processes reading on the pipe, default is 1.
  • --pipe-size N โ€” specifies the size of the pipe in bytes (for systems that support the F_SETPIPE_SZ fcntl() command). Setting a small pipe size will cause the pipe to fill and block more frequently, hence increasing the context switch rate between the pipe writer and the pipe reader processes. As of version 0.15.11 the default size is 4096 bytes โญ
  • --pipe-writers N โ€” specify number of child writer processes writing on the pipe, default is 1.
  • --pipe-vmsplice โ€” use vmsplice(2) to splice data pages to/from pipe. Requires pipe packet mode using O_DIRECT and buffer twice the size of the pipe to ensure verification data sequences. Fancy syscall behaviour, no cap ๐Ÿ’…

๐Ÿซ‚ Shared pipe stressor

  • --pipeherd N โ€” start N workers that pass a 64 bit token counter to/from 100 child processes over a shared pipe. This forces a high context switch rate and can trigger a "thundering herd" of wakeups on processes that are blocked on pipe waits ๐Ÿ˜๐Ÿ˜๐Ÿ˜
  • --pipeherd-ops N โ€” stop pipe stress workers after N bogo pipe write operations.
  • --pipeherd-procs N โ€” specify the number of child processes per stressor instance that share a pipe, range from 8 to 1024. The default is 100.
  • --pipeherd-yield โ€” force a scheduling yield after each write, this increases the context switch rate. Chaos, but make it scheduled ๐ŸŒˆ

๐Ÿ” Memory protection key mechanism stressor (Linux)

  • --pkey N โ€” start N workers that change memory protection using a protection key pkey(2) and the pkey_mprotect(2) call (Linux only). This will try to allocate a pkey and use this for the page protection, however, if this fails then the special pkey -1 will be used (and the kernel will use the normal mprotect mechanism instead). Various page protection mixes of read/write/exec/none will be cycled through on randomly chosen pre-allocated pages. Random pages getting a whole new personality, lowkey ๐ŸŽญ
  • --pkey-ops N โ€” stop after N pkey_mprotect page protection cycles.

๐Ÿงฉ Stress-ng plugin stressor

  • --plugin N โ€” start N workers that run user provided stressor functions loaded from a shared library. The shared library can contain one or more stressor functions prefixed with stress_ in their name. By default the plugin stressor will find all functions prefixed with stress_ in their name and exercise these one by one in a round-robin loop, but a specific stressor can be selected using the --plugin-method option. The stressor function takes no parameters and returns 0 for success and non-zero for failure (and will terminate the plugin stressor). Each time a stressor function is executed the bogo-op counter is incremented by one. The following example performs 10000 nop instructions per bogo-op:
int stress_example(void)
{
        int i;

        for (i = 0; i < 10000; i++) {
                __asm__ __volatile__("nop");
        }
        return 0;  /* Success */
}

and compile the source into a shared library as, for example:

gcc -fpic -shared -o example.so example.c

and run as using:

stress-ng --plugin 1 --plugin-so ./example.so
  • --plugin-method function โ€” run a specific stressor function, specify the name without the leading stress_ prefix. Just the function's given name, bestie ๐ŸŽ€
  • --plugin-ops N โ€” stop after N iterations of the user provided stressor function(s).
  • --plugin-so name โ€” specify the shared library containing the user provided stressor function(s).

โฑ๏ธ Polling stressor

  • -P N, --poll N โ€” start N workers that perform zero timeout polling via the poll(2), ppoll(2), select(2), pselect(2) and sleep(3) calls. This wastes system and user time doing nothing. Truly the "me pretending to study" of stressors ๐Ÿ˜ญ๐Ÿ’€
  • --poll-fds N โ€” specify the number of file descriptors to poll/ppoll/select/pselect on. The maximum number for select/pselect is limited by FD_SETSIZE and the upper maximum is also limited by the maximum number of pipe open descriptors allowed. So there's a ceiling, bestie, don't push it ๐Ÿ“
  • --poll-ops N โ€” stop poll stress workers after N bogo poll operations.
  • --poll-random-us N โ€” use a random timeout of N microseconds for ppoll(2) and pselect(2) calls instead of the default of 20000 microseconds.

๐Ÿงฎ Power maths functions

  • --powmath N โ€” start N workers that exercise various libm power functions with input values 0 to 1 in steps of 0.001; the results are sanity checked to ensure no variation occurs after each round of 10000 computations. Math girl summer ๐Ÿ”ฅ
  • --powmath-ops N โ€” stop after N power function bogo-operation loops.
  • --powmath-method method โ€” specify a power function to exercise. Available power function stress methods are described as follows:
    • all โ€” iterate over all the below power functions methods
    • cpow โ€” complex double power function
    • cpowf โ€” complex float power function
    • cpowl โ€” complex long double power function
    • csqrt โ€” complex double square root function (1/2 power)
    • csqrtf โ€” complex float square root function (1/2 power)
    • csqrtl โ€” complex long double square root function (1/2 power)
    • cbrt โ€” double cube root function (1/3 power)
    • cbrtf โ€” float cube root function (1/3 power)
    • cbrtl โ€” long double cube root function (1/3 power)
    • hypot โ€” double Euclidean distance function (hypotenuse)
    • hypotf โ€” float Euclidean distance function (hypotenuse)
    • hypotl โ€” long double Euclidean distance function (hypotenuse)
    • pow โ€” double power function
    • powf โ€” float power function
    • powl โ€” long double power function
    • sqrt โ€” double square root function (1/2 power)
    • sqrtf โ€” float square root function (1/2 power)
    • sqrtl โ€” long double square root function (1/2 power)

๐ŸŽ›๏ธ Prctl stressor

  • --prctl N โ€” start N workers that exercise the majority of the prctl(2) system call options. Each batch of prctl calls is performed inside a new child process to ensure the limit of prctl is contained inside a new process every time. Some prctl options are architecture specific, however, this stressor will exercise these even if they are not implemented. Fresh process, fresh prctl energy, we love containment ๐Ÿซถ
  • --prctl-ops N โ€” stop prctl workers after N batches of prctl calls

๐ŸŽ๏ธ L3 cache prefetching stressor

  • --prefetch N โ€” start N workers that benchmark prefetch and non-prefetch reads of a L3 cache sized buffer. The buffer is read with loops of 8 ร— 64 bit reads per iteration. In the prefetch cases, data is prefetched ahead of the current read position by various sized offsets, from 64 bytes to 8 K to find the best memory read throughput. The stressor reports the non-prefetch read rate and the best prefetched read rate. It also reports the prefetch offset and an estimate of the amount of time between the prefetch issue and the actual memory read operation. These statistics will vary from run-to-run due to system noise and CPU frequency scaling. So like, don't @ me if the numbers wobble, that's just the universe being loud โœจ
  • --prefetch-l3-size N โ€” specify the size of the l3 cache
  • --prefetch-method N โ€” select the prefetching method. Available methods are:
  • builtin โ€” uses the __builtin_prefetch(3) function to do the prefetching. This one's the default, bestie, so if you don't pick anything you're getting this โœจ
  • builtinl0 โ€” same __builtin_prefetch(3) function, but with a locality 0 hint
  • builtinl3 โ€” same __builtin_prefetch(3) function, but with a locality 3 hint
  • dcbt โ€” uses the ppc64 dcbt instruction to fetch data into the L1 cache (ppc64 only)
  • dcbtst โ€” uses the ppc64 dcbtst instruction to fetch data into the L1 cache (ppc64 only)
  • prefetcht0 โ€” uses the x86 prefetcht0 instruction to prefetch data into all levels of the cache hierarchy (x86 only)
  • prefetcht1 โ€” uses the x86 prefetcht1 instruction (temporal data with respect to first level cache) to prefetch data into level 2 cache and higher (x86 only)
  • prefetcht2 โ€” uses the x86 prefetcht2 instruction (temporal data with respect to second level cache) to prefetch data into level 2 cache and higher (x86 only)
  • prefetchnta โ€” uses the x86 prefetchnta instruction (non-temporal data with respect to all cache levels) into a location close to the processor, minimizing cache pollution (x86 only)
  • prfm_pldl1keep โ€” uses the aarch64 prfm instruction with the pld1keep operation (retained or temporal prefetch, allocated in the cache normally) to prefetch data into level 1 of the cache hierarchy (aarch64 only)
  • prfm_pldl2keep โ€” uses the aarch64 prfm instruction with the pld1keep operation (retained or temporal prefetch, allocated in the cache normally) to prefetch data into level 2 of the cache hierarchy (aarch64 only)
  • prfm_pldl3keep โ€” uses the aarch64 prfm instruction with the pld1keep operation (retained or temporal prefetch, allocated in the cache normally) to prefetch data into level 3 of the cache hierarchy (aarch64 only)
  • prfm_pldl1strm โ€” uses the aarch64 prfm instruction with the pld1strm operation (streaming or non-temporal prefetch, for data that is used only once) to prefetch data into level 1 of the cache hierarchy (aarch64 only)
  • prfm_pldl2strm โ€” uses the aarch64 prfm instruction with the pld1strm operation (streaming or non-temporal prefetch, for data that is used only once) to prefetch data into level 2 of the cache hierarchy (aarch64 only)
  • prfm_pldl3strm โ€” uses the aarch64 prfm instruction with the pld1strm operation (streaming or non-temporal prefetch, for data that is used only once) to prefetch data into level 3 of the cache hierarchy (aarch64 only)
  • --prefetch-ops N โ€” stop the prefetch stressors after N benchmark operations ๐Ÿ›‘

โœจ Prime number search (using large integers) stressor โœจ

  • --prime N โ€” start N workers that go hunting for prime numbers using the GNU Multiple Precision Arithmetic Library for large integers. The GMP mpz_nextprime function is what finds the primes, and it uses a probabilistic algorithm to identify larger and larger primes โ€” which means the bogo-op rate is gonna drop over time, no cap ๐Ÿ˜ญ
  • --prime-method [ factorial | inc | pwr2 | pwr10 ] โ€” picks the method used to calculate the next value from where the prime search starts, and honestly that also decides how big these primes get. The default is inc. Here's the whole menu, bestie:
    • factorial โ€” start of search based on factorial expansion. This one grows rapidly ๐Ÿ”ฅ
    • inc โ€” start of search based on increments by 2. This grows very slowly ๐ŸŒ
    • pwr2 โ€” start of search based on powers of 2. Grows relatively quickly โšก
    • pwr10 โ€” start of search based on powers of 10. Grows by 1 digit per iteration and grows quickly ๐Ÿš€
  • --prime-ops N โ€” stop after finding N prime numbers
  • --prime-progress โ€” show the number of primes found and the length of the largest prime found. This gets displayed either every 60 seconds, or more than 60 seconds if it takes longer to find the next prime ๐Ÿ‘€
  • --prime-start N โ€” start the prime search from value N. You can express the value as an integer value or as a floating point value (e.g. 1e200 to express a very large starting value) ๐Ÿ’…

โœจ Priority inversion stressor โœจ

  • --prio-inv N โ€” start N workers that exercise mutex lock priority inversion scheduling. Three child processes run with low, medium and high FIFO scheduling priorities. The processes with low and high priorities share a mutex lock that both try to lock and unlock, aiming to make the low priority process block the high priority process. Meanwhile the middle priority process will run in priority over the low priority process, causing the high priority process to become unrunnable ๐Ÿ˜ฑ
  • --prio-inv-ops N โ€” stop after N bogo lock/unlock operations
  • --prio-inv-type [ inherit | none | protect ] โ€” select the mutex lock priority inversion type. The tea:
    • inherit โ€” the priority of the process owning the mutex lock is run with the highest priority of any other process waiting on the lock to avoid priority inversion deadlock
    • none โ€” the priority of the process owning the mutex lock is not affected by its mutex ownership. This may lead to the high priority process to become unrunnable on a single thread system โš ๏ธ
    • protect โ€” the priority of the process owning the mutex lock is given the priority of the mutex (in this stress test case, the maximum priority) during the lock ownership
  • --prio-inv-policy [ batch | ext | idle | fifo | other | rr ] โ€” select the scheduling policy. "Normal" policies (batch, ext, idle and other) can be selected as an unprivileged user, however "Real Time" policies (fifo and rr) can only be selected with the appropriate privilege. By default fifo is selected but it will fall back to other for unprivileged users ๐Ÿซถ

โœจ Privileged CPU instructions stressor โœจ

  • --priv-instr N โ€” start N workers that exercise various architecture specific privileged instructions that cannot be executed by userspace programs. These instructions will be trapped and processed by SIGSEGV or SIGILL signal handlers ๐Ÿ’€
  • --priv-instr-ops N โ€” stop priv-instr stressors after N rounds of executing privileged instructions

โœจ /proc stressor โœจ

  • --procfs N โ€” start N workers that read files from /proc and recursively read files from /proc/self (Linux only) ๐Ÿง
  • --procfs-ops N โ€” stop procfs reading after N bogo read operations. Heads up though: since the number of entries may vary between kernels, this bogo ops metric is probably very misleading ๐Ÿ™ˆ

โœจ pwrite/pread lseek I/O stressor โœจ

  • --pseek N โ€” start N workers that exercise pwrite(2) and pread(2) with lseek(2) positioning tests. Each worker has 4 sub-processes that perform repeated pwrite and pread operations using the same shared file descriptor. Two of the processes are started using pthreads (if available), another two processes are started with fork(2). Using pwrite and pread should perform I/O without altering the shared file descriptor file offset. The main worker process performs I/O using lseek(2)/write(2) and lseek(2)/read(2) calls that change the file offset; lseeks are sanity checked to see if they are being altered by pwrite and pread calls ๐ŸŽ€
  • --pseek-io-size N โ€” specify size of each write/read I/O operation in bytes. Size can be from 1 byte to 1 MB ๐Ÿ“
  • --pseek-ops N โ€” stop after N writes by the main worker process
  • --pseek-rand โ€” normally each sub-process writes to a fix file offset; using this option will randomize the offset on each write/read cycle ๐ŸŽฒ

โœจ Pthread stressor โœจ

  • --pthread N โ€” start N workers that iteratively creates and terminates multiple pthreads (the default is 1024 pthreads per worker). In each iteration, each newly created pthread waits until the worker has created all the pthreads and then they all terminate together ๐Ÿงต
  • --pthread-max N โ€” create N pthreads per worker. If the product of the number of pthreads by the number of workers is greater than the soft limit of allowed pthreads then the maximum is re-adjusted down to the maximum allowed โš–๏ธ
  • --pthread-ops N โ€” stop pthread workers after N bogo pthread create operations

โœจ Ptrace stressor โœจ

  • --ptrace N โ€” start N workers that fork and trace system calls of a child process using ptrace(2) ๐Ÿ”
  • --ptrace-ops N โ€” stop ptrace workers after N bogo system calls are traced

๐Ÿ’– Pointer Chasing stressor

  • --ptr-chase N โ€” spin up N workers that literally chase memory pointers around page-sized nodes full of pointers ๐ŸŽฏ. By default each stressor instance allocates 4096 pages of nodes, and every node is an array of pointers that get randomly set to point at other node pages. Then the stressors follow randomly chosen pointers from each node and chase them around the entire node space. It's giving pointer fetching, pointer dereferencing, and it's a whole cache-read exercising stressor, periodt. Fun fact: the nodes are allocated with 50% of pages from the heap and 50% from mmap'd memory โœจ.
  • --ptr-chase-ops N โ€” stop after N pointer chases, bestie.
  • --ptr-chase-pages N โ€” pick how many pages to allocate for the nodes.

๐ŸŽ€ Pseudo-terminals (pty) stressor

  • --pty N โ€” start N workers that keep trying to open pseudoterminals and then do a bunch of pty ioctl(2) calls on the ptys before closing them again ๐Ÿซถ.
  • --pty-max N โ€” try to open a maximum of N pseudoterminals; the default is 65536. The allowed range for this setting is 8..65536.
  • --pty-ops N โ€” stop pty workers after N pty bogo operations.

๐Ÿฆ‹ Qsort stressor

  • -Q, --qsort N โ€” start N workers that sort 32 bit integers using qsort(3).
  • --qsort-method [ qsort-libc | qsort-bm ] โ€” choose either the libc implementation of qsort or the J. L. Bentley and M. D. McIlroy implementation of qsort. Default? The libc implementation ๐Ÿ’….
  • --qsort-ops N โ€” stop qsort stress workers after N bogo qsorts.
  • --qsort-size N โ€” specify the number of 32 bit integers to sort, default is 262144 (256 ร— 1024).

๐ŸŒธ Quota stressor

  • --quota N โ€” start N workers that exercise the Q_GETQUOTA, Q_GETFMT, Q_GETINFO, Q_GETSTATS and Q_SYNC quotactl(2) commands on all the available mounted block based file systems. Requires CAP_SYS_ADMIN capability to run, no cap ๐Ÿงข.
  • --quota-ops N โ€” stop quota stress workers after N bogo quotactl operations.

๐ŸŒˆ Process scheduler stressor

  • --race-sched N โ€” start N workers that exercise rapid changing CPU affinity child processes, both from the controlling stressor and by the child processes themselves. Child processes are created and terminated rapidly with the aim to create race conditions where affinity changing occurs during process run states ๐Ÿ‘‘.
  • --race-sched-method [ all | next | prev | rand | randinc | syncnext | syncprev ] โ€” select the method for moving a process to a specific CPU. The available methods are, in her own words:
    • all โ€” iterate over all the race-sched methods as listed below:
    • next โ€” move a process to the next CPU, wrap around to zero when maximum CPU is reached.
    • prev โ€” move a process to the previous CPU, wrap around to the maximum CPU when the first CPU is reached.
    • rand โ€” move a process to any randomly chosen CPU.
    • randinc โ€” move a process to the current CPU + a randomly chosen value 1..4, modulo the number of CPUs.
    • syncnext โ€” move synchronously all the race-sched stressor processes to the next CPU every second; this loads just 1 CPU at a time in a round-robin method.
    • syncprev โ€” move synchronously all the race-sched stressor processes to the previous CPU every second; this loads just 1 CPU at a time in a round-robin method.
  • --race-sched-ops N โ€” stop after N process creation bogo-operations.

๐Ÿ“ Radixsort stressor

  • --radixsort N โ€” start N workers that sort random 8 byte strings using radixsort(3).
  • --radixsort-method [ radixsort-libc | radixsort-nonlibc ] โ€” select either the libc implementation of radixsort or an optimized implementation of radixsort. The default is the libc implementation if it is available โœจ.
  • --radixsort-ops N โ€” stop radixsort stress workers after N bogo radixsorts.
  • --radixsort-size N โ€” specify the number of strings to sort, default is 262144 (256 ร— 1024).

๐Ÿงš RAM filesystem stressor

  • --ramfs N โ€” start N workers mounting a memory based file system using ramfs and tmpfs (Linux only ๐Ÿง). This alternates between mounting and umounting a ramfs or tmpfs file system using the traditional mount(2) and umount(2) system call as well as the newer Linux 5.2 fsopen(2), fsmount(2), fsconfig(2) and move_mount(2) system calls if they are available. The default ram file system size is 2 MB.
  • --ramfs-fill โ€” fill ramfs with zero'd data using fallocate(2) if it is available, or multiple calls to write(2) if not.
  • --ramfs-ops N โ€” stop after N ramfs mount operations.
  • --ramfs-size N โ€” set the ramfs size (must be multiples of the page size).

๐Ÿ”ฅ Raw device stressor

  • --rawdev N โ€” start N workers that read the underlying raw drive device using direct IO reads. The device (with minor number 0) that stores the current working directory is the raw device to be read by the stressor. The read size is exactly the size of the underlying device block size. By default, this stressor will exercise all of the rawdev methods (see the --rawdev-method option). Heads up: this is a Linux only stressor and requires root privilege to be able to read the raw device ๐Ÿ‘€.
  • --rawdev-method method โ€” the available rawdev stress methods, described as follows:
    • all โ€” iterate over all the rawdev stress methods as listed below:
    • sweep โ€” repeatedly read across the raw device from the 0th block to the end block in steps of the number of blocks on the device / 128 and back to the start again.
    • wiggle โ€” repeatedly read across the raw device in 128 evenly steps with each step reading 1024 blocks backwards from each step.
    • ends โ€” repeatedly read the first and last 128 start and end blocks of the raw device alternating from start of the device to the end of the device.
    • random โ€” repeatedly read 256 random blocks.
    • burst โ€” repeatedly read 256 sequential blocks starting from a random block on the raw device.
  • --rawdev-ops N โ€” stop the rawdev stress workers after N raw device read bogo operations.

๐Ÿ’œ Random list stressor

  • --randlist N โ€” start N workers that create a list of objects in randomized memory order and traverse the list setting and reading the objects. This is designed to exercise memory and cache thrashing ๐Ÿ˜ญ. Normally the objects are allocated on the heap, however for objects of page size or larger there is a 1 in 16 chance of objects being allocated using shared anonymous memory mapping to mix up the address spaces of the allocations to create more TLB thrashing.
  • --randist-compact โ€” allocate all the list objects using one large heap allocation and divide this up for all the list objects. This removes the overhead of the heap keeping track of each list object, hence uses less memory ๐Ÿ’….
  • --randlist-items N โ€” allocate N items on the list. By default, 100000 items are allocated.
  • --randlist-ops N โ€” stop randlist workers after N list traversals.
  • --randlist-size N โ€” allocate each item to be N bytes in size. By default, the size is 64 bytes of data payload plus the list handling pointer overhead.

๐Ÿซถ Localhost raw socket stressor

  • --rawsock N โ€” start N workers that send and receive packet data using raw sockets on the localhost. Requires CAP_NET_RAW to run.
  • --rawsock-ops N โ€” stop rawsock workers after N packets are received.
  • --rawsock-port P โ€” start at socket port P. For N rawsock worker processes, ports P to P + (N โˆ’ 1) are used (wrapped to keep in range of 1024 to 65535). The default port is port 45000.

๐ŸŒŸ Localhost ethernet raw packets stressor

  • --rawpkt N โ€” start N workers that sends and receives ethernet packets using raw packets on the localhost via the loopback device. Requires CAP_NET_RAW to run.
  • --rawpkt-ops N โ€” stop rawpkt workers after N packets from the sender process are received.
  • --rawpkt-port N โ€” start at port P. For N rawpkt worker processes, ports P to P + (N โˆ’ 1) are used (wrapped to keep in range of 1024 to 65535). The default port is port 49920.
  • --rawpkt-rxring N โ€” setup raw packets with RX ring with N number of blocks, this selects TPACKET_V. N must be one of 1, 2, 4, 8 or 16.

โญ Localhost raw UDP packet stressor

  • --rawudp N โ€” start N workers that send and receive UDP packets containing a process ID using raw sockets on the localhost. Requires CAP_NET_RAW to run.
  • --rawudp-if NAME โ€” use network interface NAME. If the interface NAME does not exist, is not up or does not support the domain then the loopback (lo) interface is used as the default ๐Ÿ™ˆ.
  • --rawudp-ops N โ€” stop rawudp workers after N packets are received.
  • --rawudp-port N โ€” start at port P. For N rawudp worker processes, ports P to P + (N โˆ’ 1) are used (wrapped to keep in range of 1024 to 65535). The default port is port 50176.

๐ŸŽฒ Random number generator stressor

  • --rdrand N โ€” spins up N workers that each read a random number from an on-chip random number generator. It's giving hardware chaos, bestie โ€” this uses the rdrand instruction on Intel x86 processors, or the darn instruction on PowerPC processors. ๐Ÿ”ฅ
  • --rdrand-ops N โ€” tells the rdrand stress workers to stop after N bogo rdrand operations (and just so u know, 1 bogo op = 2048 random bits successfully read โœจ).
  • --rdrand-seed โ€” uses rdseed instead of rdrand. x86 only, ikyk ๐Ÿ’…

๐Ÿ“– Read-ahead stressor

  • --readahead N โ€” starts N workers that randomly seek and perform 4096 byte read/write I/O operations on a file with readahead(2). The default file size is 64 MB. Readaheads and reads get batched into 16 readaheads and then 16 reads โ€” organized queen behavior ๐ŸŽ€
  • --readahead-bytes N โ€” sets the size of the readahead file, and the default is 1 GB. You can specify the size as % of free space on the file system, or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g. Slay, units ๐Ÿฆ‹
  • --readahead-ops N โ€” stop the readahead stress workers after N bogo read operations.

๐Ÿ” Reboot stressor

  • --reboot N โ€” starts N workers that exercise the reboot(2) system call. When possible, it creates a process in a PID namespace and performs a reboot power off command that should shutdown the process. It also exercises invalid reboot magic values and invalid reboots when there are insufficient privileges โ€” those ones will not actually reboot the system. don't panic bestie, it's a fake-out ๐Ÿ’€
  • --reboot-ops N โ€” stop the reboot stress workers after N bogo reboot cycles.

๐Ÿ” POSIX regular expressions stressor

  • --regex N โ€” starts N workers that compile various POSIX regular expressions and execute them against a set of text strings. It exercises the regex C library with a whole range of various simple and complex regex expressions. matching era fr fr โœจ
  • --regex-ops N โ€” stop after N regex compilations.

๐Ÿงฎ CPU registers stressor

  • --regs N โ€” starts N workers that shuffle data around the CPU registers, exercising register move instructions. Each bogo-op represents 1000 calls of a shuffling function that shuffles the registers 32 times. Only implemented for the GCC compiler, since this requires register annotations and optimization level 0 to compile appropriately. that's the whole vibe check, no cap ๐ŸŒธ
  • --regs-bitflip โ€” flips all the bits (invert) in each register after each register has been re-assigned. On some processors this may consume more power and generate more heat ๐Ÿ”ฅ๐Ÿ”ฅ careful, she's spicy
  • --regs-ops N โ€” stop regs stressors after N bogo operations.

๐Ÿ—‚๏ธ Memory page reordering stressor

  • --remap N โ€” starts N workers that map 512 pages and re-order these pages using the deprecated system call remap_file_pages(2). Several page re-orderings are exercised: forward, reverse, random and many pages to 1 page. deprecated but iconic, honestly ๐Ÿ’…
  • --remap-mlock โ€” attempts to mlock(2) mmap'd huge pages into memory, causing more memory pressure by preventing pages from being swapped out.
  • --remap-ops N โ€” stop after N remapping bogo operations.
  • --remap-pages N โ€” specify the number of pages to remap. It must be a power of 2, and the default is 512 pages.

โœ๏ธ Renaming file stressor

  • -R N, --rename N โ€” starts N workers that each create a file and then repeatedly rename it. she's literally just moving the file around, main character energy ๐ŸŽ€
  • --rename-ops N โ€” stop rename stress workers after N bogo rename operations.

โš–๏ธ Process rescheduling stressor

  • --resched N โ€” starts N workers that exercise process rescheduling. Each stressor spawns a child process for each of the positive nice levels and iterates over the nice levels from 0 to the lowest priority level (highest nice value). For each of the nice levels, 1024 iterations over 3 non-real time scheduling policies SCHED_OTHER, SCHED_BATCH and SCHED_IDLE are set, and a sched_yield(2) occurs to force heavy rescheduling activity. When the -v verbose option is used, the distribution of the number of yields across the nice levels is printed for the first stressor out of the N stressors. okay that's a lot but we ate ๐Ÿซถ
  • --resched-ops N โ€” stop after N rescheduling sched_yield calls.

๐Ÿงบ System resources stressor

  • --resources N โ€” starts N workers that consume various system resources. Each worker will spawn a default of 256 child processes that iterate 1024 times consuming shared memory, heap, stack, temporary files and various file descriptors (eventfds, memoryfds, userfaultfds, pipes and sockets). she's greedy and that's valid ๐Ÿ’œ
  • --resources-mlock โ€” attempts to mlock(2) mmap'd pages into memory, causing more memory pressure by preventing pages from being swapped out.
  • --resources-num N โ€” specify the number of resource loops used per child process to consume N allocation and accessing rounds of resources. The default is 1024.
  • --resources-ops N โ€” stop after N resource child forks.
  • --resources-procs N โ€” specify the number of child processes to spawn per stressor instance, range 1 to 4096. The default is 256.

๐Ÿ™ƒ Writing temporary files in reverse position stressor

  • --revio N โ€” starts N workers continually writing in reverse position order to temporary files. The default mode is to stress test reverse position ordered writes with randomly sized sparse holes between each write. With the --aggressive option enabled without any --revio-opts options, the revio stressor will work through all the --revio-opt options one by one to cover a range of I/O options. unhinged but make it efficient โœจ
  • --revio-bytes N โ€” write N bytes for each revio process, the default is 1 GB. One can specify the size as % of free space on the file system or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g.
  • --revio-opts list โ€” specify various stress test options as a comma separated list. Options are the same as --hdd-opts but without the iovec option, and with a readahead option to force a readahead action over the entire file once it has been completely written.
  • --revio-ops N โ€” stop revio stress workers after N bogo operations.
  • --revio-write-size N โ€” specify size of each write in bytes. Size can be from 1 byte to 4 MB.

๐Ÿ’ Ring pipes stressor

  • --ring-pipe N โ€” starts N workers that move data around a ring of pipes using poll to detect when data is ready to copy. By default, 256 pipes are used with two 4096 byte items of data being copied around the ring of pipes. Data is copied using read and write system calls. If the splice system call is available then one can use splice to use more efficient in-kernel data passing instead of buffer copying. pipes in a circle, it's giving ouroboros ๐Ÿ๐Ÿ’…
  • --ring-pipe-num N โ€” specify the number of pipes to use. Ranges from 4 to 262144, default is 256.
  • --ring-pipe-ops N โ€” stop after N pipe data transfers.
  • --ring-pipe-size N โ€” specify the size of data being copied in bytes. Ranges from 1 to 4096, default is 4096.
  • --ring-pipe-splice โ€” enable splice to move data between pipes (only if splice() is available). ๐Ÿงš

๐Ÿšง Rlimit stressor

  • --rlimit N โ€” starts N workers that exceed resource limits via setting rlimit(2) and trying to exceed these limits, generating SIGXCPU, SIGXFSZ and SIGSEGV signals. she's breaking the rules on purpose, periodt ๐Ÿ’€
  • --rlimit-ops N โ€” stop after N bogo resource limited SIGXCPU, SIGXFSZ and SIGSEGV signals have been caught.

๐Ÿ—บ๏ธ VM reverse-mapping stressor

  • --rmap N โ€” starts N workers that exercise the VM reverse-mapping. This creates 16 processes per worker that write/read multiple file-backed memory mappings. There are 64 lots of 4 page mappings made onto the file, with each mapping overlapping the previous by 3 pages and at least 1 page of non-mapped memory between each of the mappings. Data is synchronously msync'd to the file 1 in every 256 iterations in a random manner. overlapping mappings, messy but correct ๐Ÿฆ‹
  • --rmap-ops N โ€” stop after N bogo rmap memory writes/reads.
  • --rmap-procs N โ€” specify the number of processes per worker to exercise the reverse mapping. The range is 8 to 256, with a default of 16.

๐Ÿ”’ Read-only file system stressor

  • --rofs N โ€” starts N workers that exercise read-only mounted file systems. By default this will try and exercise all mounted read-only file systems with access(2), read(2), lstat(2), listxattr(2), mmap(2), lseek(2), flock(2) and statx(2) system calls. respectfully poking the untouchable files ๐Ÿ‘‘
  • --rofs-dir directory โ€” specify a directory where a read-only file system is mounted, this overrides the default to find mounted read-only file systems.
  • --rofs-ops N โ€” stop after N read-only file system bogo-operations.

๐ŸŒ€ 1 bit rotation stressor

  • --rotate N โ€” starts N workers that exercise 1 bit rotates left and right of unsigned integer variables. The default will rotate four 8, 16, 32, 64 (and if supported 128) bit values 10000 times in a loop per bogo-op. spinny lil bits โœจ
  • --rotate-method method โ€” specify the method of rotation to use. The all method uses all the methods and is the default. slay, all of them ๐Ÿ’…
  • all โ€” go absolutely feral and run every rotate stressor method (list below, bestie):
  • rol8 โ€” 8 bit unsigned rotate left by 1 bit
  • ror8 โ€” 8 bit unsigned rotate right by 1 bit
  • rol16 โ€” 16 bit unsigned rotate left by 1 bit
  • ror16 โ€” 16 bit unsigned rotate right by 1 bit
  • rol32 โ€” 32 bit unsigned rotate left by 1 bit
  • ror32 โ€” 32 bit unsigned rotate right by 1 bit
  • rol64 โ€” 64 bit unsigned rotate left by 1 bit
  • ror64 โ€” 64 bit unsigned rotate right by 1 bit
  • rol128 โ€” 128 bit unsigned rotate left by 1 bit
  • ror128 โ€” 128 bit unsigned rotate right by 1 bit

  • --rotate-ops N โ€” dip out after N bogo rotate operations. iconic exit strategy ๐Ÿ’…

๐ŸŒ€ Restartable sequences (rseq) stressor (Linux)

  • --rseq N โ€” spin up N workers that literally exercise restartable sequences through the rseq(2) system call. It loops over a long-duration critical section that's likely to get interrupted (that's the whole point, fr fr). A rseq abort handler keeps a count of how many interruptions happened, and a SIGSEGV handler also tracks any failed rseq aborts that can happen if there's a mismatch in a rseq check signature. Linux only, obviously ๐Ÿง
  • --rseq-ops N โ€” stop after N bogo rseq operations. Heads up: each single bogo rseq operation is equivalent to 10000 iterations over a long duration rseq handled critical section. so like, that's a lot ๐Ÿซ 

โฐ Real-time clock stressor

  • --rtc N โ€” start N workers that go poke at the real time clock (RTC) interfaces via /dev/rtc and /sys/class/rtc/rtc0. And no, she does not do destructive writes (modifications) on the RTC โ€” we're respectful in this house ๐ŸŽ€ This is a Linux only stressor.
  • --rtc-ops N โ€” stop after N bogo RTC interface accesses.

๐ŸŽ›๏ธ Scheduler mix stressor

  • --schedmix N โ€” start N workers, and each one starts child processes that repeatedly pick a random scheduling policy and then execute a short-duration, randomly chosen time-consuming activity. This exercises rapid rescheduling of processes and generates a large amount of scheduling timer interrupts. chaos, but make it scheduler-flavored ๐Ÿ”ฅ
  • --schedmix-cpumix โ€” move child processes to randomly chosen CPUs for CPU mixing ๐ŸŒ€
  • --schedmix-ops N โ€” stop after N scheduling mixed operations.
  • --schedmix-procs N โ€” specify how many child processes to run for each stressor instance, range from 1 to 64, default is 16.

๐Ÿ‘‘ Scheduling policy stressor

  • --schedpolicy N โ€” start N workers that set the worker to various available scheduling policies out of SCHED_OTHER, SCHED_BATCH, SCHED_IDLE, SCHED_FIFO, SCHED_RR, SCHED_DEADLINE and SCHED_EXT. For the real time scheduling policies a random sched priority is selected between the minimum and maximum scheduling priority settings. main character energy for your scheduler โœจ
  • --schedpolicy-cpumix โ€” move child processes to randomly chosen CPUs for CPU mixing ๐ŸŒ€
  • --schedpolicy-ops N โ€” stop after N bogo scheduling policy changes.
  • --schedpolicy-rand โ€” select the scheduling policy randomly so that the new policy is always different to the previous policy. The default is to work through the scheduling policies sequentially. lowkey the default is more organized, but okay go off ๐Ÿซถ

๐Ÿฆ‹ Stream control transmission protocol (SCTP) stressor

  • --sctp N โ€” start N workers that perform network sctp stress activity using the Stream Control Transmission Protocol (SCTP). This involves client/server processes doing rapid connect, send/receives and disconnects on the local host. it's giving networking speedrun ๐Ÿƒโ€โ™€๏ธ
  • --sctp-domain D โ€” specify the domain to use, the default is ipv4. Currently ipv4 and ipv6 are supported.
  • --sctp-if NAME โ€” use network interface NAME. If the interface NAME does not exist, is not up or does not support the domain, then the loopback (lo) interface is used as the default. fallback queen ๐Ÿ’…
  • --sctp-max-size N โ€” specify the maximum data size in bytes, with the range 16 to 65535 and the default as 8192.
  • --sctp-ops N โ€” stop sctp workers after N bogo operations.
  • --sctp-port P โ€” start at sctp port P. For N sctp worker processes, ports P to P + (N โˆ’ 1) are used (wrapped to keep in range of 1024 to 65535). The default port is port 50176.
  • --sctp-sched [ fc | fcfs | prio | rr | wfq ] โ€” specify SCTP scheduler, one of fc (fair capacity), fcfs (first come first served, the default), prio (priority), rr (round-robin) or wfq (weighted fair queueing).

๐Ÿงš File sealing (SEAL) stressor (Linux)

  • --seal N โ€” start N workers that exercise the fcntl(2) SEAL commands on a page sized anonymous file created using memfd_create(2). After each SEAL command is issued the stressor also sanity checks if the seal operation has sealed the file correctly. (Linux only).
  • --seal-ops N โ€” stop after N bogo seal operations.

๐Ÿ”’ Secure computing stressor

  • --seccomp N โ€” start N workers that exercise the Secure Computing system call filtering. Each worker creates child processes that write a short message to /dev/null and then exits. 2% of the child processes have a seccomp filter that disallows the write system call and hence it is killed by seccomp with a SIGSYS. Note that this stressor can generate many audit log messages each time the child is killed. Requires CAP_SYS_ADMIN to run. ๐Ÿ’€
  • --seccomp-ops N โ€” stop seccomp stress workers after N seccomp filter tests.

๐Ÿคซ Secret memory stressor (Linux โ‰ฅ 5.11)

  • --secretmem N โ€” start N workers that mmap pages using file mapping off a memfd_secret(2) file descriptor. Each stress loop iteration will expand the mappable region by 3 pages using ftruncate and mmap and touches the pages. The pages are then fragmented by unmapping the middle page and then umapping the first and last pages. This tries to force page fragmentation and also trigger out of memory (OOM) kills of the stressor when the secret memory is exhausted. Note this is a Linux 5.11+ only stressor and the kernel needs to be booted with "secretmem=" option to allocate a secret memory reservation. sneaky but make it memory ๐ŸŒธ
  • --secretmem-ops N โ€” stop secretmem stress workers after N stress loop iterations.

๐Ÿ” File seek stressor

  • --seek N โ€” start N workers that randomly seeks and performs 512 byte read/write I/O operations on a file. The default file size is 16 GB.
  • --seek-ops N โ€” stop seek stress workers after N bogo seek operations.
  • --seek-punch โ€” punch randomly located 8 K holes into the file to cause more extents to force a more demanding seek stressor, (Linux only). hole-punching, but consensual ๐Ÿ•ณ๏ธ
  • --seek-size N โ€” specify the size of the file in bytes. Small file sizes allow the I/O to occur in the cache, causing greater CPU load. Large file sizes force more I/O operations to drive causing more wait time and more I/O on the drive. One can specify the size in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g. pick your fighter โญ

๐Ÿšฆ POSIX semaphore stressor

  • --sem N โ€” start N workers that perform POSIX semaphore wait and post operations. By default, a parent and 4 children are started per worker to provide some contention on the semaphore. This stresses fast semaphore operations and produces rapid context switching. so much switching, so little time ๐Ÿ˜ญ
  • --sem-ops N โ€” stop semaphore stress workers after N bogo semaphore operations.
  • --sem-procs N โ€” start N child workers per worker to provide contention on the semaphore, the default is 4 and a maximum of 64 are allowed.
  • --sem-shared โ€” share the semaphore across all sem stressor instances. Normally each semaphore stressor shares a semaphore with its child processes, this option produces more locking contention and less throughput by sharing a semaphore across all semaphore stressor processes. sharing is caring, but at what cost ๐Ÿ’œ

๐Ÿงฉ System V semaphore stressor

  • --sem-sysv N โ€” start N workers that perform System V semaphore wait and post operations. By default, a parent and 4 children are started per worker to provide some contention on the semaphore. This stresses fast semaphore operations and produces rapid context switching.
  • --sem-sysv-ops N โ€” stop semaphore stress workers after N bogo System V semaphore operations.
  • --sem-sysv-procs N โ€” start N child processes per worker to provide contention on the System V semaphore, the default is 4 and a maximum of 64 are allowed.
  • --sem-sysv-setall โ€” sets the semval values for all the semaphores in the child's semaphore set. This depends on the semctl SETALL op being defined and GETALL succeeding and is an opt-in option as it will affect the semaphore being exercised. you've been warned, bestie โš ๏ธ

๐Ÿ“จ Sendfile stressor

  • --sendfile N โ€” start N workers that send an empty file to /dev/null using the sendfile(2) call. This operation spends nearly all the time in the kernel. The default sendfile size is 4 MB. The sendfile options are for Linux only. ๐Ÿง
  • --sendfile-ops N โ€” stop sendfile workers after N sendfile bogo operations.
  • --sendfile-size N โ€” specify the size to be copied with each sendfile call. The default size is 4 MB. One can specify the size in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g.

๐ŸŽ€ Sessions stressor

  • --session N โ€” start N workers that create child and grandchild processes that set and get their session ids. 25% of the grandchild processes are not waited for by the child to create orphaned sessions that need to be reaped by init. orphan era, the way init has to adopt them all ๐Ÿ˜ญ๐Ÿซถ
  • --session-ops N โ€” wrap it up after N child processes have been spawned and reaped ๐Ÿซถ

๐Ÿงš Setting data in the Kernel stressor ๐Ÿงš

๐Ÿš Shellsort stressor ๐Ÿš

  • --shellsort N โ€” start N workers that sort 32 bit integers using shellsort(3). tiny algorithm, big main character energy ๐Ÿ’…
  • --shellsort-ops N โ€” stop the shellsort stress workers after N bogo shellsorts ๐ŸŽ€
  • --shellsort-size N โ€” how many 32 bit integers to sort. default is 262144 (that's 256 ร— 1024, math slay) ๐ŸŒธ

๐Ÿซง POSIX shared memory stressor ๐Ÿซง

  • --shm N โ€” start N workers that open and allocate shared memory objects using the POSIX shared memory interfaces. by default the test will repeatedly create and destroy 32 shared memory objects, each one 8 MB in size. it's giving memory pressure ๐Ÿ’€
  • --shm-bytes N โ€” set the size of the POSIX shared memory objects being created. you can pass it as a % of total available memory, or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g ๐Ÿฆ‹
  • --shm-mlock โ€” attempt to mlock(2) the shared memory objects into memory, which causes more memory pressure by preventing pages from being swapped out ๐Ÿ”ฅ
  • --shm-objs N โ€” how many shared memory objects to create, iykyk
  • --shm-ops N โ€” stop after N POSIX shared memory create and destroy bogo operations are complete โœจ

๐ŸงŠ System V shared memory stressor ๐ŸงŠ

  • --shm-sysv N โ€” start N workers that allocate shared memory using the System V shared memory interface. by default the test will repeatedly create and destroy 8 shared memory segments, each 8 MB in size โœจ
  • --shm-sysv-bytes N โ€” set the size of the shared memory segment to be created. you can specify it as a % of total available memory, or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g ๐Ÿ’–
  • --shm-sysv-mlock โ€” attempt to mlock(2) the shared memory segment into memory, causing more memory pressure by preventing pages from being swapped out ๐Ÿ˜ค
  • --shm-sysv-ops N โ€” stop after N shared memory create and destroy bogo operations are complete ๐ŸŽ€
  • --shm-sysv-segs N โ€” how many shared memory segments to create. the default is 8 segments, no cap ๐Ÿซถ

๐Ÿ’€ SIGABRT stressor ๐Ÿ’€

  • --sigabrt N โ€” start N workers that create children which get killed by SIGABRT signals or by calling abort(3) ๐Ÿ’…
  • --sigabrt-ops N โ€” stop the sigabrt workers after N SIGABRT signals are successfully handled ๐ŸŽ€

๐ŸšŒ SIGBUS stressor ๐ŸšŒ

  • --sigbus N โ€” start N workers that rapidly create and catch bus errors, generated via misaligned access and by accessing a file backed memory mapping that doesn't have file storage to back the page being accessed. yes, that's as chaotic as it sounds ๐Ÿ˜ญ
  • --sigbus-ops N โ€” stop the sigbus stress workers after N bogo bus errors ๐ŸŒˆ

๐Ÿ‘ถ SIGCHLD stressor ๐Ÿ‘ถ

  • --sigchld N โ€” start N workers that create children to generate SIGCHLD signals. this exercises children that exit (CLD_EXITED), get killed (CLD_KILLED), get stopped (CLD_STOPPED) or continued (CLD_CONTINUED). full child lifecycle arc, honestly ๐Ÿฆ‹
  • --sigchld-ops N โ€” stop the sigchld workers after N SIGCHLD signals are successfully handled โœจ

๐Ÿง SIGFD stressor (Linux) ๐Ÿง

  • --sigfd N โ€” start N workers that generate SIGRT signals, which get handled by reads by a child process using a file descriptor set up using signalfd(2). (Linux only, bestie ๐Ÿง) this will generate a heavy context switch load when all CPUs are fully loaded ๐Ÿ”ฅ
  • --sigfd-ops โ€” stop sigfd workers after N bogo SIGUSR1 signals are sent ๐Ÿ’…

โž— SIGFPE stressor โž—

  • --sigfpe N โ€” start N workers that rapidly cause division by zero SIGFPE faults. math said no ๐Ÿ˜ญ
  • --sigfpe-ops N โ€” stop the sigfpe stress workers after N bogo SIGFPE faults ๐ŸŽ€

๐Ÿ“ž SIGHUP stressor ๐Ÿ“ž

  • --sighup N โ€” start N workers that generate SIGHUP signals using raise(2) and by killing a group leader process, with a child process indirectly receiving SIGHUP when it loses the group leader. rude but iconic ๐Ÿ’…
  • --sighup-ops N โ€” stop the sighup stressor workers after N SIGHUP signals โœจ

๐Ÿšซ SIGILL stressor ๐Ÿšซ

  • --sigill N โ€” start N workers that execute illegal instructions to generate SIGILL signals. breaking the rules on purpose, love that for them ๐Ÿ’€
  • --sigill-ops N โ€” stop the sigill stressor workers after N SIGILL signals ๐Ÿฆ‹

๐Ÿ“จ SIGIO stressor ๐Ÿ“จ

  • --sigio N โ€” start N workers that read data from a child process via a pipe and generate SIGIO signals. this exercises asynchronous I/O via SIGIO, lowkey fancy ๐ŸŒธ
  • --sigio-ops N โ€” stop the sigio stress workers after handling N SIGIO signals ๐Ÿซถ

๐Ÿšฆ Signal stressor ๐Ÿšฆ

  • --signal N โ€” start N workers that exercise the signal system call with three different signal handlers: SIG_IGN (ignore), a SIGCHLD handler and SIG_DFL (default action). for the SIGCHLD handler, the stressor sends itself a SIGCHLD signal and checks whether it's been handled. for the other handlers, the stressor checks that the SIGCHLD handler has not been called. this stress test calls the signal system call directly when possible and will try to avoid the C library's little habit of replacing signal with the more modern sigaction system call. sneaky, but we're onto it ๐Ÿ‘€
  • --signal-ops N โ€” stop the signal stress workers after N rounds of signal handler setting โœจ

๐Ÿช† Nested signal handling stressor ๐Ÿช†

  • --signest N โ€” start N workers that exercise nested signal handling. a signal gets raised, and inside the signal handler a different signal gets raised, working through a list of signals to exercise. an alternative signal stack is used that's large enough to handle all the nested signal calls. the -v option will log the approximate size of the stack required and the average stack size per nested call ๐Ÿ“ so helpful
  • --signest-ops N โ€” stop after handling N nested signals ๐Ÿ’–

โณ Pending signals stressor โณ

  • --sigpending N โ€” start N workers that check if SIGUSR1 signals are pending. this stressor masks SIGUSR1, generates a SIGUSR1 signal and uses sigpending(2) to see if the signal is pending. then it unmasks the signal and checks that it's no longer pending. will it hang? won't it? the drama ๐ŸŽญ
  • --sigpending-ops N โ€” stop the sigpending stress workers after N bogo sigpending pending/unpending checks ๐ŸŽ€

๐Ÿšฐ SIGPIPE stressor ๐Ÿšฐ

  • --sigpipe N โ€” start N workers that repeatedly spawn off child processes which exit before a parent can complete a pipe write, causing a SIGPIPE signal. the child processes are either spawned using clone(2) if it's available, or they use the slower fork(2) instead ๐Ÿ’…
  • --sigpipe-ops N โ€” stop N workers after N SIGPIPE signals have been caught and handled โœจ

๐Ÿ“ฌ Signal queueing stressor ๐Ÿ“ฌ

  • --sigq N โ€” start N workers that rapidly send SIGUSR1 signals using sigqueue(3) to child processes waiting for the signal via sigwaitinfo(2). pass the message bestie ๐Ÿซถ
  • --sigq-ops N โ€” stop the sigq stress workers after N bogo signal send operations ๐Ÿฆ‹

โฐ Real-time signals stressor โฐ

  • --sigrt N โ€” start N workers that each create child processes to handle SIGRTMIN to SIGRMAX real time signals. the parent sends each child process an RT signal via siqueue(2) and the child process waits for it via sigwaitinfo(2). when the child receives the signal it then sends an RT signal to one of the other child processes, also via sigqueue(2). it's a whole group chat of signals honestly ๐Ÿ˜ญ
  • --sigrt-ops N โ€” stop the sigrt stress workers after N bogo sigqueue signal send operations ๐Ÿ”ฅ

๐Ÿ’ฅ SIGSEGV stressor ๐Ÿ’ฅ

  • --sigsegv N โ€” start N workers that rapidly create and catch segmentation faults, generated via illegal memory access, illegal vdso system calls, illegal port reads, illegal interrupts or access to the x86 time stamp counter. absolute menace behaviour, we stan ๐Ÿ’€
  • --sigsegv-ops N โ€” stop the sigsegv stress workers after N bogo segmentation faults ๐ŸŒˆ

๐Ÿ›‘ SIGSTOP stressor ๐Ÿ›‘

  • --sigstop N โ€” start N workers that have a child process which stops itself with SIGSTOP, plus a parent process that detects this with a SIGCHLD so it can resume the child with a SIGCONT signal. freeze, detect, unfreeze โ€” the full routine โ„๏ธ
  • --sigstop-ops N โ€” stop after N kills using SIGSTOP and SIGCONT โœจ

๐Ÿ›Œ Waiting for process signals stressor ๐Ÿ›Œ

  • --sigsuspend N โ€” start N workers that each spawn off 4 child processes which wait for a SIGUSR1 signal from the parent using sigsuspend(2). the parent sends SIGUSR1 signals to each child in rapid succession. each sigsuspend wakeup counts as one bogo operation ๐ŸŒธ
  • --sigsuspend-ops N โ€” stop the sigsuspend stress workers after N bogo sigsuspend wakeups ๐ŸŽ€

๐Ÿชค SIGTRAP stressor ๐Ÿชค

  • --sigtrap N โ€” start N workers that exercise the SIGTRAP signal. for systems that support SIGTRAP, the signal is generated using raise(SIGTRAP). only on x86 Linux systems is the SIGTRAP also generated by an int 3 instruction ๐Ÿ‘€
  • --sigtrap-ops N โ€” stop the sigtrap stress workers after N SIGTRAP signals have been handled ๐Ÿ’…

๐Ÿ“ก SIGURG stressor ๐Ÿ“ก

  • --sigurg N โ€” start workers that exercise the SIGURG signal by sending out-of-band data over a TCP/IP IPv4 socket stream. oob data said ๐Ÿ‘‹
  • --sigurg-ops N โ€” stop the sigurg stressor workers once N SIGURG signals have been handled. โœจ

๐Ÿ’œ SIGVTARLM stressor ๐Ÿ’œ

  • --sigvtalrm N โ€” start N workers that exercise the SIGVTALRM signal using an ITIMER_VIRTUAL itimer, plus a busy loop that eats CPU time by calling getitimer on the ITIMER_VIRTUAL timer. no cap, it's just vibing on CPU cycles ๐Ÿ˜ญ
  • --sigvtalrm-ops N โ€” stop the sigvtalrm stress workers after N SIGVTALRM signals have been handled. slay ๐ŸŽ€

๐Ÿ”ฅ SIGXCPU stressor ๐Ÿ”ฅ

  • --sigxcpu N โ€” start N workers that exercise the SIGXCPU stressor. A busy loop generates SIGXCPU signals by setting a 0 second run time limit and then following it up with a sched_yield(2) call. it's giving "chaos on purpose" ๐Ÿ’…
  • --sigxcpu-ops N โ€” stop the sigsxcpu stress workers after N bogo SIGXCPU signal attempts.

๐ŸŒธ SIGXFSZ stressor ๐ŸŒธ

  • --sigxfsz N โ€” start N workers that exercise the SIGXFSZ stressor. A random 32 bit file size limit gets set, and then data is written outside that size limit just to generate a SIGXFSZ signal. icon behavior honestly ๐Ÿฆ‹
  • --sigxfsz-ops N โ€” stop the sigsxfsz stress workers after N bogo SIGXFSZ signal attempts.

๐ŸŽ€ Random memory and processor cache line stressor via a skiplist ๐ŸŽ€

  • --skiplist N โ€” start N workers that store integers and then search for them using a skiplist. By default, 65536 integers are added and searched. This is a genuinely useful method to exercise random access of memory and the processor cache. obsessed with this one ngl โญ
  • --skiplist-ops N โ€” stop the skiplist worker after N skiplist store and search cycles are completed.
  • --skiplist-size N โ€” specify the size (number of integers) to store and search in the skiplist. Size can be from 1 K to 4 M. ๐Ÿซถ

๐Ÿ’… Time interrupts and context switches stressor ๐Ÿ’…

  • --sleep N โ€” start N workers that spawn off multiple threads, and each one performs multiple sleeps in ranges of 1us to 0.1s. This creates multiple context switches and timer interrupts. lowkey stressful, highkey iconic ๐Ÿ˜ญ
  • --sleep-affinity โ€” change the CPU affinity to a randomly selected CPU whenever the sleep is 1 microsecond or larger.
  • --sleep-max P โ€” start P threads per worker. The default is 1024, the maximum allowed is 30000. bestie do not go past 30000, fr fr ๐Ÿ’€
  • --sleep-ops N โ€” stop after N sleep bogo operations.

๐ŸŒˆ Sleeping pthread wakeup storm stressor ๐ŸŒˆ

  • --sleepstorm N โ€” start N workers that run multiple pthreads which wait on a real time signal from the parent stressor instance. The wakeup signal from the parent happens periodically (default every 50 milliseconds), which creates a whole storm of runnable pthreads that execute for a short time before waiting on the next signal. The default of 64 pthreads are created per stressor instance. The sleepstorm stressor is designed to exercise large spikes of runnable processes, which in turn exercises the scheduler when it's selecting the next runnable processes. it's giving scheduler main character energy ๐Ÿ‘‘
  • --sleepstorm-cpumix โ€” move pthreads to randomly chosen CPUs for CPU mixing.
  • --sleepstorm-ops N โ€” stop after N rounds of pthread wakeups.
  • --sleepstorm-pthreads N โ€” specify the number of pthreads to spawn per stressor instance, range 1 to 30000, with a default of 64.
  • --sleepstorm-sleep-ms N โ€” sleep for N milliseconds after waking up all the pthreads, range 1 to 1000, with a default of 50 (e.g. 200 Hz).
  • --sleepstorm-yield [ always | never | random ] โ€” specify the method of calling sched_yield(2) in each pthread. The methods are always (every time a pthread is woken up), never (never yield), and random (randomly choose between yielding or not yielding on each wakeup). v cute options honestly ๐ŸŽ€

๐Ÿงš System management interrupts (SMI) stressor ๐Ÿงš

  • --smi N โ€” start N workers that attempt to generate system management interrupts (SMIs) into the x86 ring -2 system management mode (SMM) by exercising the advanced power management (APM) port 0xb2. This requires the --pathological option and root privilege, and it's only implemented on x86 Linux platforms. This probably does not work in a virtualized environment. The stressor will attempt to determine the time stolen by SMIs with some naรฏve benchmarking.
๐Ÿšจ heads up bestie: root + --pathological or it's not happening. also probably broken in a VM, so don't come for me ๐Ÿ’€
  • --smi-ops N โ€” stop after N attempts to trigger the SMI.

๐Ÿ“ Sound PCM stressor ๐Ÿ“

  • --snd-pcm N โ€” start N workers that exercise /dev/snd/pcm*[cp] devices. Currently this exercises a subset of the /dev/snd PCM ioctl commands looking for concurrency race conditions. ๐Ÿ”Šโœจ
  • --snd-pcm-ops N โ€” stop after N bogo ioctl commands.

โญ Sound Timer stressor โญ

  • --snd-timer N โ€” start N workers that exercise /dev/snd/timer (Linux only). This rapidly sets up a timer event, then waits and reads it via select() and read(). The timer event is checked to see if it's monotonically increasing. ๐Ÿ•ฐ๏ธ
  • --snd-timer-ops N โ€” stop after N timer events have been read.

๐Ÿ”ฅ Network socket stressor ๐Ÿ”ฅ

  • -S N, --sock N โ€” start N workers that perform various socket stress activity. This involves a pair of client/server processes performing rapid connects, sends, receives and disconnects on the local host. literally a whole situationship in socket form ๐Ÿ’…
  • --sock-domain D โ€” specify the domain to use, the default is ipv4. Currently ipv4, ipv6 and unix are supported.
  • --sock-if NAME โ€” use network interface NAME. If the interface NAME doesn't exist, isn't up, or doesn't support the domain, then the loopback (lo) interface is used as the default. fallback queen ๐ŸŒธ
  • --sock-msgs N โ€” send N messages per connect, send/receive, disconnect iteration. The default is 1000 messages. If N is too small then the rate gets throttled back by the overhead of socket connect and disconnect (on Linux, one needs to increase /proc/sys/net/netfilter/nf_conntrack_max to allow more connections). iykyk ๐Ÿ‘€
  • --sock-nodelay โ€” this disables the TCP Nagle algorithm, so data segments are always sent as soon as possible. This stops data from being buffered before being transmitted, which results in poorer network utilisation and more context switches between the sender and the receiver. speed > efficiency energy, honestly ๐Ÿ˜ญ
  • --sock-ops N โ€” stop the socket stress workers after N bogo operations.
  • --sock-opts [ random | send | sendmsg | sendmmsg ] โ€” by default, messages are sent using send(2). This option lets you specify the sending method using send(2), sendmsg(2), sendmmsg(2), or a random selection of one of these 3 on each iteration. Note that sendmmsg is only available on Linux systems that support this system call. pick your fighter ๐ŸฅŠ
  • --sock-port P โ€” start at socket port P. For N socket worker processes, ports P to P + (N โˆ’ 1) are used (wrapped to keep in range of 1024 to 65535). The default port is port 50944.
  • --sock-protocol P โ€” use the specified protocol P, default is tcp. Options are tcp and mptcp (if supported by the operating system).
  • --sock-type [ stream | seqpacket ] โ€” specify the socket type to use. The default type is stream. seqpacket currently only works for the unix socket domain.
  • --sock-zerocopy โ€” enable zerocopy for send and recv calls if the MSG_ZEROCOPY is supported. โœจ zero copies, zero problems (maybe) โœจ

๐Ÿ’€ Socket abusing stressor ๐Ÿ’€

  • --sockabuse N โ€” start N workers that abuse a socket file descriptor with various file based systems that don't normally act on sockets. The kernel should handle these illegal and unexpected calls gracefully. we're being little menaces on purpose ๐Ÿ™ˆ
  • --sockabuse-ops N โ€” stop after N iterations of the socket abusing stressor loop.
  • --sockabuse-port P โ€” start at socket port P. For N sockabuse worker processes, ports P to P + (N โˆ’ 1) are used (wrapped to keep in range of 1024 to 65535). The default port is port 51200.

๐Ÿฆ‹ Socket diagnostic stressor (Linux) ๐Ÿฆ‹

  • --sockdiag N โ€” start N workers that exercise the Linux sock_diag netlink socket diagnostics (Linux only). This currently requests diagnostics using UDIAG_SHOW_NAME, UDIAG_SHOW_VFS, UDIAG_SHOW_PEER, UDIAG_SHOW_ICONS, UDIAG_SHOW_RQLEN and UDIAG_SHOW_MEMINFO for the AF_UNIX family of socket connections. all the diagnostics, all at once, no notes ๐Ÿ‘‘
  • --sockdiag-ops N โ€” stop after receiving N sock_diag diagnostic messages.

๐Ÿ’œ Socket file descriptor stressor ๐Ÿ’œ

  • --sockfd N โ€” start N workers that pass file descriptors over a UNIX domain socket using the CMSG(3) ancillary data mechanism. For each worker, a pair of client/server processes are created; the server opens as many file descriptors on /dev/null as possible and passes these over the socket to a client that reads these from the CMSG data and immediately closes the files. fd hot potato fr fr ๐Ÿฅ”
  • --sockfd-ops N โ€” stop the sockfd stress workers after N bogo operations.
  • --sockfd-port P โ€” start at socket port P. For N sockfd worker processes, ports P to P + (N โˆ’ 1) are used (wrapped to keep in range of 1024 to 65535). The default port is port 51456.
  • --sockfd-reuse โ€” reuse the file descriptor by passing it back from the receiver to the sender and re-sending it again, rather than opening /dev/null each time. sustainable queen ๐ŸŒฑ

๐ŸŒˆ Opening network socket stressor ๐ŸŒˆ

  • --sockmany N โ€” start N workers that use a client process to attempt to open as many as 100000 TCP/IP socket connections to a server on port 10000. go big or go home ๐Ÿ˜ค
  • --sockmany-if NAME โ€” use network interface NAME. If the interface NAME doesn't exist, isn't up, or doesn't support the domain, then the loopback (lo) interface is used as the default.
  • --sockmany-max-size N โ€” specify the maximum data size in bytes, with the range 1 to 32768 and the default as 8.
  • --sockmany-ops N โ€” stop after N connections.
  • --sockmany-port P โ€” where the port party starts, bestie: begin at socket port P. For N sockmany worker processes, ports P to P + (N โˆ’ 1) get used (and they wrap around to stay in the 1024 to 65535 range, no cap). Default port? 51712. ๐Ÿ’…

๐ŸŒธ Socket I/O stressor ๐ŸŒธ

  • --sockpair N โ€” spin up N workers doing socket pair I/O read/writes. It's literally a pair of client/server processes throwing randomly sized socket I/O operations at each other. Iconic little duo behavior. ๐Ÿซถ
  • --sockpair-max-size N โ€” the maximum data size in bytes. Range is 1 to 65535, and the default is 4096. Big vibes, bounded vibes.
  • --sockpair-ops N โ€” stop the socket pair stress workers after N bogo operations. Periodt.

๐Ÿ”ฅ Softlockup stressor ๐Ÿ”ฅ

  • --softlockup N โ€” start N workers that flip between the "real-time" SCHED_FIO and SCHED_RR scheduling policies at the highest priority to force softlockups. This one is not casual:
This can only be run with CAP_SYS_NICE capability, and for best results the number of stressors should be at least the number of online CPUs. When it's running, it's practically impossible to stop, and it will force softlockup issues and may trigger watchdog timeout reboots. ๐Ÿ’€ Like, actually. Reboots.
  • --softlockup-ops N โ€” stop softlockup stress workers after N bogo scheduler policy changes.

๐Ÿงš Sparse matrix stressor ๐Ÿงš

  • --sparsematrix N โ€” start N workers that exercise 3 different sparse matrix implementations, built on hashing, Judy array (for 64 bit systems), 2-d circular linked-lists, memory mapped 2-d matrix (non-sparse), quick hashing (on preallocated nodes) and red-black tree. The sparse matrix gets populated with values, random values that potentially don't exist get read, known existing values get read, and known existing values get marked as zero. The default 500 ร— 500 sparse matrix is used and 5000 items are put into the sparse matrix, making it 2% utilized. Efficiency queen. โœจ
  • --sparsematrix-items N โ€” populate the sparse matrix with N items. If N is greater than the number of elements in the sparse matrix, then N gets capped so you get at most a 100% full sparse matrix.
  • --sparsematrix-method [ all | hash | hashjudy | judy | list | mmap | qhash | rb ] โ€” specify the type of sparse matrix implementation to use. The all method uses all the methods and is the default. Here's the whole lineup, no skipping:
    • all โ€” exercise with all the sparsematrix stressor methods (see below).
    • hash โ€” use a hash table and allocate nodes on the heap for each unique value at a (x, y) matrix position.
    • hashjudy โ€” use a hash table for x coordinates and a Judy array for y coordinates for values at a (x, y) matrix position.
    • judy โ€” use a Judy array with a unique 1-to-1 mapping of (x, y) matrix position into the array.
    • list โ€” use a circular linked-list for sparse y positions, each with circular linked-lists for sparse x positions for the (x, y) matrix coordinates.
    • mmap โ€” use a non-sparse mmap of the entire 2-d matrix space. Only (x, y) matrix positions that are referenced will get physically mapped. Note that large sparse matrices cannot be mmap'd due to lack of virtual address limitations, and too many referenced pages can trigger the out of memory killer on Linux. ๐Ÿ˜ญ Careful.
    • qhash โ€” use a hash table with pre-allocated nodes for each unique value. This is a quick hash table implementation: nodes are not allocated each time with calloc and are allocated from a pre-allocated pool, leading to quicker hash table performance than the hash method. Speedy slay.
    • rb โ€” use a red-black balanced tree using one tree node for each unique value at a (x, y) matrix position.
    • splay โ€” use a splay tree using one tree node for each unique value at a (x, y) matrix position.
  • --sparsematrix-ops N โ€” stop after N sparsematrix test iterations.
  • --sparsematrix-size N โ€” use an N ร— N sized sparse matrix.

๐Ÿ‘‘ POSIX process spawn (posix_spawn) stressor (Linux) ๐Ÿ‘‘

  • --spawn N โ€” start N workers continually spawning children using posix_spawn(3) that exec stress-ng and then exit almost immediately. Currently Linux only. Little baby processes, born and gone in a blink. ๐Ÿฆ‹
  • --spawn-ops N โ€” stop spawn stress workers after N bogo spawns.

๐Ÿ’œ Speculative Rollback stressor ๐Ÿ’œ

  • --spec-rollback N โ€” start N workers that try to force branch misprediction and rollback flushes of a mispredicted pipeline. By default, data is fetched from a random value from an array of 256 64 bit integers as part of the misprediction logic.
  • --spec-rollback-ops N โ€” stop after N ร— 1024 branch misprediction operations.
  • --spec-rollback-size N โ€” set the random data array size to N elements. This is 256 by default, minimum 16 to maximum of 8388608. Optimal when N is a power of 2. Math girlies stay winning. ๐ŸŒˆ

โญ Spin on memory for process synchronization stressor โญ

  • --spinmem N โ€” start N workers that use a shared memory page to keep two processes synchronized using busy spin loops. One process is a writer that increments a value in memory slot 0 and spin waits for the data to appear in memory slot 1. The other process spin waits for the data to change in slot 0 and copies the changed value into memory slot 1. The stressor benchmarks the time for the transactions to occur between both processes. Note that the optimal number of stressors is half the number of online CPUs in a system. By default 32 bit write/reads are used.
  • --spinmem-affinity โ€” move spinmem stressor processes to randomly selected CPUs every million spinmem transactions. Keep 'em guessing. ๐ŸŽ€
  • --spinmem-method method โ€” select the size of the memory write/reads; the default is 32 bit. 128 bit and/or atomic read/writes may not be supported by some toolchains. The spinmem methods are as follows:
    • 8bit โ€” 8 bit read/writes
    • 16bit โ€” 16 bit read/writes
    • 32bit โ€” 32 bit read/writes
    • 64bit โ€” 64 bit read/writes
    • 128bit โ€” 128 bit read/writes (may not be supported)
    • 8bitatomic โ€” 8 bit atomic read/writes (may not be supported)
    • 16bitatomic โ€” 16 bit atomic read/writes (may not be supported)
    • 32bitatomic โ€” 32 bit atomic read/writes (may not be supported)
    • 64bitatomic โ€” 64 bit atomic read/writes (may not be supported)
  • --spinmem-ops N โ€” stop after N spinmem bogo operations. A bogo operation is 1000 transactions between the two spinmem processes.
  • --spinmem-yield โ€” force scheduling yields after each spinmem read/write operation.

๐Ÿ“ Splice stressor (Linux) ๐Ÿ“

  • --splice N โ€” move data from /dev/zero to /dev/null through a pipe without any copying between kernel address space and user address space using splice(2). This is only available for Linux. Zero-copy royalty, honestly. ๐Ÿ‘‘
  • --splice-bytes N โ€” transfer N bytes per splice call, the default is 64 K. One can specify the size as % of total available memory or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g.
  • --splice-ops N โ€” stop after N bogo splice operations.

๐Ÿ’– Stack stressor ๐Ÿ’–

  • --stack N โ€” start N workers that rapidly cause and catch stack overflows by use of large recursive stack allocations. Much like the brk stressor, this can eat up pages rapidly and may trigger the kernel OOM killer on the process โ€” however, the killed stressor is respawned again by a monitoring parent process. Resilient queen. ๐Ÿ”ฅ
  • --stack-fill โ€” the default action is to touch the lowest page on each stack allocation. This option touches all the pages by filling the new stack allocation with zeros, which forces physical pages to be allocated and hence is more aggressive.
  • --stack-mlock โ€” attempt to mlock(2) stack pages into memory, causing more memory pressure by preventing pages from being swapped out.
  • --stack-ops N โ€” stop stack stress workers after N bogo stack overflows.
  • --stack-pageout โ€” force stack pages out to swap (available when madvise(2) supports MADV_PAGEOUT).
  • --stack-unmap โ€” unmap a single page in the middle of a large buffer allocated on the stack on each stack allocation. This forces the stack mapping into multiple separate allocation mappings.

๐ŸŒธ Dirty page and stack exception stressor ๐ŸŒธ

  • --stackmmap N โ€” start N workers that use a 2 MB stack that is memory mapped onto a temporary file. A recursive function works down the stack and flushes dirty stack pages back to the memory mapped file using msync(2) until the end of the stack is reached (stack overflow). This exercises dirty page and stack exception handling. Down she goes. ๐Ÿ˜ญ
  • --stackmmap-ops N โ€” stop workers after N stack overflows have occurred.

๐Ÿฆ‹ Statmount and listmount system call stressor ๐Ÿฆ‹

  • --statmount N โ€” start N workers that find mounts on / via listmount and get mount information on the mount IDs using statmount. (Linux only).
  • --statmount-ops N โ€” stop workers after iterating on mounts N times.

โœจ Libc string functions stressor โœจ

  • --str N โ€” start N workers that exercise various libc string functions on random strings. String girlie behavior, fr fr. ๐Ÿ’…
  • --str-method strfunc โ€” pick exactly which libc string function you wanna put under pressure. The roster is literally: all, index, rindex, strcasecmp, strcat, strchr, strcoll, strcmp, strcpy, strlen, strncasecmp, strncat, strncmp, strrchr and strxfrm. Peep string(3) if you want the deets on these bad boys. all is the default and it'll run through every single string method, no skips ๐Ÿ’…
  • --str-ops N โ€” bestie, just dip after N bogo string operations.

๐Ÿง  STREAM memory stressor

  • --stream N โ€” fire up N workers running a memory bandwidth stressor that's very loosely based on the STREAM "Sustainable Memory Bandwidth in High Performance Computers" benchmarking tool by John D. McCalpin, Ph.D. โœจ This one allocates 3 buffers sized at the CPU L3 cache and just keeps doing rounds of these computations on big arrays of double precision floating point numbers:
    • copy โ€” c[i] = a[i]
    • scale โ€” b[i] = scalar ร— c[i]
    • add โ€” c[i] = a[i] + b[i]
    • triad โ€” a[i] = b[i] + (c[i] ร— scalar)
๐Ÿšจ Since this is only loosely based on a variant of the STREAM benchmark code, DO NOT submit results based on this. It's here in stress-ng purely to stress memory and compute โ€” it is NOT intended for STREAM accurate tuned or non-tuned benchmarking, periodt. If you want real accurate and standardised STREAM benchmarks, go use the official STREAM benchmarking tool. ๐Ÿ™

The stressor calculates the memory read rate, memory write rate and floating point operations rate. These are gonna differ from the maximum theoretical read/write/compute rates because of loop overheads and the use of volatile pointers to make sure the compiler doesn't optimize out stores. iykyk ๐Ÿ˜Œ

  • --stream-discontiguous โ€” tries to make the mmap'd physical pages discontiguous by forcing pages to be in randomly mixed physical page locations. Chaos, but make it memory ๐ŸŒ€
  • --stream-index N โ€” sets how many stream indices get used to index into the data arrays a, b and c. It adds indirection into the data lookup by using randomly shuffled indexing into those three data arrays. Level 0 (no indexing) is the default, and 3 is where all 3 arrays are indexed via 3 different randomly shuffled indexes. The higher the index setting, the more it wrecks L1, L2 and L3 caching, and that's exactly what forces higher memory read/write latencies. ๐Ÿ”ฅ
  • --stream-l3-size N โ€” tell it the CPU Level 3 cache size in bytes. You can specify the size in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g. If you don't provide the L3 cache size, stress-ng will try to work it out itself, and if that flops it defaults the size to 4 MB. ๐ŸŽ€
  • --stream-mlock โ€” attempts to mlock(2) the stream buffers into memory so they don't get swapped out. Protect the vibes ๐Ÿซถ
  • --stream-madvise [ collapse | hugepage | nohugepage | normal ] โ€” sets the madvise(2) options used on the memory mapped buffer in the stream stressor. Non-linux systems will only have the normal madvise advice. Default is normal โœจ
  • --stream-ops N โ€” stop after N stream bogo operations, where one bogo operation = one round of copy, scale, add and triad. Count 'em ๐Ÿ‘‘
  • --stream-prefetch โ€” compilers like gcc have optimization options that insert prefetching into memory fetch loops, which may improve read performance. This option enables that optimization โ€” but ngl it may lead to degraded performance if the compiler doesn't insert the prefetching in the right places ๐Ÿ˜ญ Best to enable this for the default --stream-index 0 setting.

๐Ÿ”ข String to/from Numeric conversions stressor

  • --strnum 1 โ€” start N workers that exercise a bunch of libc string to/from numeric conversion functions. Every 1000 bogo iterations, a fresh randomized set of signed and unsigned integers (int, long, long long) and floating point values (float, double, long double) gets generated, and conversions are performed on them to string values and from string values back to their original type. Round trip slay ๐Ÿ’…
  • --strnum-ops N โ€” stop after N bogo string/numeric conversion operations.
  • --strnum-method method โ€” choose the preferred conversion function, bestie. The options are:
    • all โ€” select all the available conversion methods
    • atoi โ€” convert a string to a signed integer using atoi()
    • atol โ€” convert a string to a signed long integer using atol()
    • atoll โ€” convert a string to a signed long long integer using atoll()
    • strtoul โ€” convert a string to an unsigned long integer using strtoul()
    • strtoull โ€” convert a string to an unsigned long long integer using stroull()
    • sscanf-i โ€” convert a string to a signed integer using sscanf()
    • sscanf-li โ€” convert a string to a signed long integer using sscanf()
    • sscanf-lli โ€” convert a string to a signed long long integer using sscanf()
    • sscanf-u โ€” convert a string to an unsigned integer using sscanf()
    • sscanf-lu โ€” convert a string to an unsigned long integer using sscanf()
    • sscanf-llu โ€” convert a string to an unsigned long long integer using sscanf()
    • snprintf-i โ€” convert a signed integer to a string using snprintf()
    • snprintf-li โ€” convert a signed long integer to a string using snprintf()
    • snprintf-lli โ€” convert a signed long long integer to a string using snprintf()
    • strtof โ€” convert a string to a float using strtof()
    • strtod โ€” convert a string to a double using strtof()
    • strtold โ€” convert a string to a long double using strtof()
    • sscanf-f โ€” convert a string to a float using sscanf()
    • sscanf-d โ€” convert a string to a double using sscanf()
    • sscanf-ld โ€” convert a string to a long double using sscanf()
    • strfromf โ€” convert a float to a string using strfromf()
    • strfromd โ€” convert a double to a string using strfromd()
    • strfroml โ€” convert a long double to a string using strfroml()

๐Ÿง Swap partitions stressor (Linux)

  • --swap N โ€” start N workers that add and remove small randomly sized swap partitions (Linux only, bestie ๐Ÿง). Heads up: if too many swap partitions get added, the stressors may exit with exit code 3 (not enough resources). Requires CAP_SYS_ADMIN to run. The swap stressor also generates bogus swap headers to exercise the kernel swap header checks, so yeah โ€” warnings are gonna appear in the kernel log ๐Ÿ’€
  • --swap-ops N โ€” stop the swap workers after N swapon/swapoff iterations.
  • --swap-self โ€” attempt to swap out pages of the stressor itself. Iconic self-sabotage ๐ŸŽ€

๐Ÿ” Context switching between mutually tied processes stressor

  • -s N, --switch N โ€” start N workers that force context switching between two mutually blocking/unblocking tied processes. By default it's message passing over a pipe, but there are different methods available ๐Ÿ‘€
  • --switch-freq F โ€” run the context switching at the frequency of F context switches per second. Note that the specified switch rate may not actually be achieved because of CPU speed and memory bandwidth limitations. Bestie, physics said no ๐Ÿ˜ญ
  • --switch-method [ mq | pipe | sem-sysv ] โ€” pick the preferred context switch block/run synchronization method:
    • mq โ€” use posix message queue with a 1 item size. Messages are passed between a sender and receiver process.
    • pipe โ€” single character messages are passed down a single character sized pipe between a sender and receiver process.
    • sem-sysv โ€” a SYSV semaphore is used to block/run two processes.
  • --switch-ops N โ€” stop context switching workers after N bogo operations.
  • --symlink N โ€” start N workers creating and removing symbolic links. It's giving file system chaos โœจ
  • --symlink-ops N โ€” stop symlink stress workers after N bogo operations.
  • --symlink-sync โ€” sync dirty data and metadata to disk. Flush it, bestie ๐Ÿšฝ๐Ÿ’…

๐Ÿ’พ Partial file syncing (sync_file_range) stressor

  • --sync-file N โ€” start N workers that perform a range of data syncs across a file using sync_file_range(2). Three mixes of syncs get performed: from start to the end of the file, from end of the file to the start, and a random mix. A random selection of valid sync types is used, covering the SYNC_FILE_RANGE_WAIT_BEFORE, SYNC_FILE_RANGE_WRITE and SYNC_FILE_RANGE_WAIT_AFTER flag bits ๐Ÿ”ฅ
  • --sync-file-bytes N โ€” specify the size of the file to be sync'd. You can specify the size as % of free space on the file system in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g.
  • --sync-file-ops N โ€” stop sync-file workers after N bogo sync operations.

๐ŸŽ€ CPU synchronized loads stressor ๐ŸŽ€

  • --syncload N โ€” spins up N workers that make sporadic, short-lived loads, and the whole point is that they're synchronized across all N stressor processes, bestie. By default you get repeated cycles of 125ms busy load followed by 62.5ms sleep, and every worker does it in step so you get these adorable coordinated bursts of load โ€” all to exercise C state transitions and CPU frequency scaling. The busy load and the sleeps both have ยฑ10% jitter added to try exercising scheduling patterns. It's giving โœจsynchronized chaosโœจ.
  • --syncload-msbusy M โ€” specify the busy load duration in milliseconds. ๐Ÿซถ
  • --syncload-mssleep M โ€” specify the sleep duration in milliseconds. ๐Ÿ˜ด
  • --syncload-ops N โ€” stop syncload workers after N load/sleep cycles. periodt.

๐Ÿ’€ System calls bad address and fault handling stressor ๐Ÿ’€

  • --sysbadaddr N โ€” starts N workers that deliberately pass bad addresses to system calls to exercise bad address and fault handling. The addresses used are: null pointers, read only pages, write only pages, unmapped addresses, text only pages, unaligned addresses and top of memory addresses. It's literally just handing the kernel garbage and seeing if it catches it ๐Ÿซถ.
  • --sysbadaddr-ops N โ€” stop the sysbadaddr stressors after N bogo system calls.

๐Ÿฆ‹ System calls stressor ๐Ÿฆ‹

  • --syscall N โ€” starts N workers that exercise a range of available system calls. System calls that fail due to lack of capabilities or errors are ignored (no cap, no problem ๐Ÿ’…). The stressor will try to maximize the rate of system calls being executed based on the entire time taken to setup, run and cleanup after each system call. Obsessed with efficiency tbh.
  • --syscall-method method โ€” picks which system calls get executed, based on the fastest test duration times. Note that this includes the time to setup, execute the system call and cleanup afterwards. The available methods are as follows:
    • all โ€” select all the available system calls
    • fast10 โ€” select the fastest 10% system call tests
    • fast25 โ€” select the fastest 25% system call tests
    • fast50 โ€” select the fastest 50% system call tests
    • fast75 โ€” select the fastest 75% system call tests
    • fast90 โ€” select the fastest 90% system call tests
    • geomean1 โ€” select tests that are less or equal to the geometric mean of all the test times
    • geomean1 โ€” select tests that are less or equal to 2 ร— the geometric mean of all the test times
    • geomean1 โ€” select tests that are less or equal to 3 ร— the geometric mean of all the test times
ngl bestie, yes, that's geomean1 written three times in the original โ€” I'm not fixing it, I'm just reporting it exactly as it is ๐Ÿ’€
  • --syscall-rank [ name | average | min | max ] โ€” select ranking of top fastest system calls, ranked by system call name, average duration, minimum duration or maximum duration. Pick your fave metric ๐Ÿ‘‘
  • --syscall-ops N โ€” stop after N system calls.
  • --sycsall-top N โ€” report the fastest top N system calls. Setting N to zero will report all the system calls that could be exercised. Zero = all, iconic behaviour fr fr.

๐ŸŒธ System information stressor ๐ŸŒธ

  • --sysinfo N โ€” start N workers that continually read system and process specific information. This reads the process user and system times using the times(2) system call. On Linux systems it also reads overall system statistics using the sysinfo(2) system call, plus the file system statistics for all mounted file systems using statfs(2). Look at her go, reading everything ๐Ÿ”ฅ
  • --sysinfo-ops N โ€” stop the sysinfo workers after N bogo operations.

๐Ÿงš System calls with invalid arguments stressor (Linux) ๐Ÿงš

  • --sysinval N โ€” start N workers that exercise system calls in random order with permutations of invalid arguments to force kernel error handling checks. The stress test auto-detects system calls that cause processes to crash or exit prematurely and will blocklist these after several repeated breakages. System call arguments that cause system calls to work successfully are also detected and blocklisted too. Linux only, obviously. ๐Ÿง
  • --sysinval-ops N โ€” stop sysinval workers after N system call attempts.

โญ /sys sysfs stressor (Linux) โญ

  • --sysfs N โ€” start N workers that recursively read files from /sys (Linux only). Heads up: this may cause specific kernel drivers to emit messages into the kernel log ๐Ÿ‘€.
  • --sysfs-ops N โ€” stop sysfs reading after N bogo read operations. Note: since the number of entries may vary between kernels, this bogo ops metric is probably very misleading. She said what she said ๐Ÿ’€.

๐Ÿ“ Tee stressor (Linux) ๐Ÿ“

  • --tee N โ€” move data from a writer process to a reader process through pipes and to /dev/null without any copying between kernel address space and user address space, using tee(2). This is only available for Linux. Zero-copy queen ๐Ÿ‘‘.
  • --tee-ops N โ€” stop after N bogo tee operations.

โฐ Timer event stressor (Linux) โฐ

  • -T N, --timer N โ€” start N workers creating timer events at a default rate of 1 MHz (Linux only); this can create many thousands of timer clock interrupts. Each timer event is caught by a signal handler and counted as a bogo timer op. ๐Ÿ˜ญ she's noisy.
  • --timer-freq F โ€” run timers at F Hz; range from 1 to 1000000000 Hz (Linux only). By selecting an appropriate frequency stress-ng can generate hundreds of thousands of interrupts per second. Note: it is also worth using --timer-slack 0 for high frequencies to stop the kernel from coalescing timer events. Don't let the kernel merge your vibes ๐Ÿซถ.
  • --timer-ops N โ€” stop timer stress workers after N bogo timer events (Linux only).
  • --timer-rand โ€” select a timer frequency based around the timer frequency ยฑ12.5% random jitter. This tries to force more variability in the timer interval to make the scheduling less predictable. Chaos, but make it clockwork ๐ŸŒˆ.

๐Ÿฆ‹ Timerfd stressor (Linux) ๐Ÿฆ‹

  • --timerfd N โ€” start N workers creating timerfd events at a default rate of 1 MHz (Linux only); this can create many thousands of timer clock events. Timer events are waited for on the timer file descriptor using select(2) and then read and counted as a bogo timerfd op. Fd girlies rise ๐Ÿ’….
  • --timerfs-fds N โ€” try to use a maximum of N timerfd file descriptors per stressor.
yes bestie, that's spelled --timerfs-fds in the original. Not touching it ๐Ÿ™ˆ
  • --timerfd-freq F โ€” run timers at F Hz; range from 1 to 1000000000 Hz (Linux only). By selecting an appropriate frequency stress-ng can generate hundreds of thousands of interrupts per second. Highkey unhinged.
  • --timerfd-ops N โ€” stop timerfd stress workers after N bogo timerfd events (Linux only).
  • --timerfd-rand โ€” select a timerfd frequency based around the timer frequency ยฑ12.5% random jitter. This tries to force more variability in the timer interval to make the scheduling less predictable. Slay, but unpredictable ๐Ÿ’œ.

๐ŸŽ€ Timer Mix stressor ๐ŸŽ€

  • --timermix N โ€” start N workers creating timer and itimer signals at a high rate; this can create many thousands of timer clock interrupts per second. Each signal that gets handled is counted as a bogo-operation. For timers, the following clocks types (where available) are used: CLOCK_REALTIME, CLOCK_MONOTONIC, CLOCK_PROCESS_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID, CLOCK_BOOTTIME and CLOCK_TAI. For itimers, the following interval timer types are used: ITIMER_REAL, ITIMER_VIRTUAL and ITIMER_PROF. Some systems may support none or a subset of these timer or itimer types. The frequency of the itimers is auto-adjusted to try and maximize the timer interrupt rate. Look at her adapting ๐Ÿงš
  • --timermix-ops N โ€” stop after N signals from timers and itimers.

๐ŸŒˆ Time warp stressor ๐ŸŒˆ

  • --time-warp N โ€” start N workers that read the system time and, where appropriate for monotonic clocks, perform a check for reverse time warping. At the end of the run there are time wrap-around checks. This stressor exercises clock_gettime(2) on all available clocks, gettimeofday(2), time(2) and getrusage(2) to check for unexpected time behaviour. Note that only some clocks are reliably monotonic. So don't come for her if a clock lies ๐Ÿ‘€.
  • --time-warp-ops N โ€” stop after N rounds of checking all the available clocks and time fetching system calls.

๐Ÿ’œ NUMA Translation lookaside buffer shootdowns stressor ๐Ÿ’œ

  • --tlb-numa N โ€” start N workers that force Translation Lookaside Buffer (TLB) shootdowns, with pages being bound to randomly selected NUMA nodes and stressor pthreads being moved to randomly selected CPUs. On x86 systems, the largest number of TLB entries in L1 or L2 caches is used to determine the number of pages being mmap'd in total by all the stressor instances. Other systems use a default of 512 entries. Note that this stressor can be used on non-NUMA systems. Inclusive king ๐Ÿ”ฅ
  • --tlb-numa-entries N โ€” specify the number of TLB entries to override the default.
  • --tlb-numa-nombind โ€” disable NUMA memory policy changes that move pages to NUMA nodes using mbind(2).
  • --tlb-numa-nopageout โ€” disable randomized page-outs of mmap'd pages. This reduces the number of TLB shootdowns. Fewer shootdowns, calmer vibe ๐Ÿ˜Œ
  • --tlb-ops N โ€” stop after N tlb pthread loop operations. This may not necessarily relate to any real TLB throughput metric. For reliable metrics, use the --metrics option. Fr fr, use --metrics ๐Ÿ’…

๐ŸŽ€ Translation lookaside buffer shootdowns stressor ๐ŸŽ€

  • --tlb-shootdown N โ€” start N workers that force Translation Lookaside Buffer (TLB) shootdowns. This is achieved by creating up to 16 child processes that all share a region of memory, and these processes are shared amongst the available CPUs. The processes adjust the page mapping settings causing TLBs to be force flushed on the other processors, causing the TLB shootdowns. It's giving coordinated group-chat drama, but for memory pages ๐Ÿ’€โœจ
  • --tlb-shootdown-ops N โ€” stop after N bogo TLB shootdown operations are done-done. ๐Ÿ’…

๐ŸŒธ Tmpfs stressor ๐ŸŒธ

  • --tmpfs N โ€” start N workers that make a temp file on whatever tmpfs file system is available, then do a whole bunch of file-based mmap operations on it. Iconic file-system chaos. ๐ŸŽ€
  • --tmpfs-mmap-async โ€” turn on file-based memory mapping and use async msync'ing on every page โ€” peep --tmpfs-mmap-file for the sibling behavior. โœจ
  • --tmpfs-mmap-file โ€” turn on tmpfs file-based memory mapping, and by default use synchronous msync'ing on each page. ๐Ÿฆ‹
  • --tmpfs-ops N โ€” stop the tmpfs stressors after N bogo mmap operations. periodt.

๐Ÿซถ Touching files stressor ๐Ÿซถ

  • --touch N โ€” touch files using open(2) or creat(2), then close and unlink them. The filename contains the bogo-op number and gets incremented on every touch operation, so this literally fills up the dentry cache. Heads up: user time and system time may be super low because most of the runtime is just waiting on file I/O โ€” which means you get absolutely massive bogo-op rates for the very low CPU time used. no cap. ๐Ÿ˜ญ
  • --touch-method [ random | open | creat ] โ€” pick the method used to create the file: randomly using open(2) or create(2), just open(2) with the O_CREAT open flag, or with creat(2).
  • --touch-ops N โ€” stop the touch workers after N file touches. ๐Ÿ“
  • --touch-opts [ all | direct | dsync | excl | noatime | sync ] โ€” specify various file open options as a comma separated list. The options are:
    • all โ€” use all the open options, namely direct, dsync, excl, noatime and sync
    • direct โ€” try to minimize cache effects of the I/O to and from this file, using the O_DIRECT open flag.
    • dsync โ€” ensure output has been transferred to underlying hardware and file metadata has been updated, using the O_DSYNC open flag.
    • excl โ€” fail if file already exists (it should not).
    • noatime โ€” do not update the file last access time if the file is read.
    • sync โ€” ensure output has been transferred to underlying hardware using the O_SYNC open flag.

๐Ÿงš Tree data structures stressor ๐Ÿงš

  • --tree N โ€” start N workers that exercise tree data structures. Default behavior is to add, find and remove 250000 32 bit integers into AVL (avl), binary, btree, red-black (rb), splay (splay) and treap trees. The whole point of this stressor is to exercise memory and cache with the various tree operations. ๐ŸŒˆ
  • --tree-method [ all | avl | binary | btree | rb | splay | treap ] โ€” specify which tree to use. By default all the trees get used (the all option). slay.
  • --tree-ops N โ€” stop tree stressors after N bogo ops. One bogo op covers the addition, finding and removing of all the items into the tree(s). ๐Ÿ’–
  • --tree-size N โ€” specify the size of the tree, where N is the number of 64 bit integers to be added into the tree. โญ

๐Ÿ’œ Trigonometric functions stressor ๐Ÿ’œ

  • --trig N โ€” start N workers that exercise sin, cos, sincos (where available) and tan libm trigonometric functions using float, double and long double floating point variants. Each function gets exercised 10000 times per bogo-operation. math girl summer fr fr. ๐Ÿ”ฅ
  • --trig-method function โ€” specify a trigonometric stress function. By default all the functions are exercised sequentially, but you can specify just one function if you need to. Available options are:
    • all โ€” iterate through all of the following trigonometric functions
    • cos โ€” cosine (double precision)
    • cosf โ€” cosine (float precision)
    • cosl โ€” cosine (long double precision)
    • sin โ€” sine (double precision)
    • sinf โ€” sine (float precision)
    • sinl โ€” sine (long double precision)
    • sincos โ€” sine and cosine (double precision)
    • sincosf โ€” sine and cosine (float precision)
    • sincosl โ€” sine and cosine (long double precision)
    • tan โ€” tangent (double precision)
    • tanf โ€” tangent (float precision)
    • tanl โ€” tangent (long double precision)
  • --trig-ops N โ€” stop after N bogo-operations. ๐Ÿฆ‹

โญ Time stamp counter (TSC) stressor โญ

  • --tsc N โ€” start N workers that read the Time Stamp Counter (TSC) 256 times per loop iteration (bogo operation). This exercises the tsc instruction for x86, the mftb instruction for ppc64, the rdcycle instruction for RISC-V, the tick instruction on SPARC and the rdtime.d instruction for Loong64. hardware go brrrr. ๐Ÿ’€
  • --tsc-lfence โ€” add lfence after each tsc read to force serialization (x86 only).
  • --tsc-ops N โ€” stop the tsc workers after N bogo operations are completed. ๐ŸŽ€
  • --tsc-rdtscp โ€” use the rdtscp instruction instead of rdtsc (x86 only). This also disables the --tsc-lfence option. ๐Ÿ™ˆ

๐ŸŒธ Binary tree search stressor ๐ŸŒธ

  • --tsearch N โ€” start N workers that insert, search and delete 32 bit integers on a binary tree using tsearch(3), tfind(3) and tdelete(3). By default there are 65536 randomized integers used in the tree. It's a genuinely useful way to exercise random access of memory and processor cache. ๐Ÿ‘‘
  • --tsearch-ops N โ€” stop the tsearch workers after N bogo tree operations are completed. โœจ
  • --tsearch-size N โ€” specify the size (number of 32 bit integers) in the array to tsearch. Size can be from 1 K to 4 M. ๐ŸŒธ

๐Ÿฆ‹ Network tunnel stressor ๐Ÿฆ‹

  • --tun N โ€” start N workers that create a network tunnel device, send and receive packets over the tunnel using UDP, then destroy it. A new random 192.168.. IPv4 address gets used each time a tunnel is created. ๐Ÿซถ
  • --tun-ops N โ€” stop after N iterations of creating/sending/receiving/destroying a tunnel.
  • --tun-port P โ€” start at port P. For N tun worker processes, ports P to P + (N + 16) โˆ’ 1 are used (wrapped to keep in range of 1024 to 65535). The default port is port 51968. ๐Ÿ”ฅ
  • --tun-tap โ€” use a network tap device using level 2 frames (bridging) rather than a tun device for level 3 raw packets (tunnelling).

๐Ÿ’… UDP network stressor ๐Ÿ’…

  • --udp N โ€” start N workers that transmit data using UDP. This involves a pair of client/server processes doing rapid connects, sends, receives and disconnects on the local host. Data is transmitted in increasing size from at least 16 bytes to the maximum data size (default of 1024 bytes) in increasing steps of 16. ๐Ÿ“
  • --udp-domain D โ€” specify the domain to use, default is ipv4. Currently ipv4 and ipv6 are supported.
  • --udp-gro โ€” enable UDP-GRO (Generic Receive Offload) if it's supported. โœจ
  • --udp-if NAME โ€” use network interface NAME. If the interface NAME doesn't exist, isn't up, or doesn't support the domain, then the loopback (lo) interface is used as the default. ๐Ÿ’œ
  • --udp-lite โ€” use the UDP-Lite (RFC 3828) protocol (only for ipv4 and ipv6 domains). Heads up: UDP-Lite was removed from Linux 7.1 and this option will fail. ๐Ÿ˜ญ
  • --udp-max-size N โ€” specify the maximum data size in bytes, range 16 to 65507.
  • --udp-ops N โ€” stop udp stress workers after N bogo operations. โญ
  • --udp-port P โ€” start at port P. For N udp worker processes, ports P to P + (N โˆ’ 1) are used (wrapped to keep in range of 1024 to 65535). The default port is port 52224. ๐ŸŽ€

๐ŸŒˆ UDP flooding stressor ๐ŸŒˆ

  • --udp-flood N โ€” start N workers that attempt to flood the host with UDP packets to randomly selected ports. The IP addresses of the packets are currently not spoofed. This is only available on systems that support AF_PACKET. ๐Ÿ’€
  • --udp-flood-domain D โ€” specify the domain to use, default is ipv4. Currently ipv4 and ipv6 are supported.
  • --udp-flood-if NAME โ€” use network interface NAME. If the interface NAME doesn't exist, isn't up, or doesn't support the domain, then the loopback (lo) interface is used as the default. ๐Ÿฆ‹
  • --udp-flood-max-size N โ€” specify the maximum data size in bytes, range 1 to 65507.
  • --udp-flood-ops N โ€” stop udp-flood stress workers after N bogo operations. ๐Ÿ™ˆ

๐ŸŽ€ File umask stressor ๐ŸŽ€

  • --umask N โ€” start N workers that exercise setting umask and creating/fstat'ing/closing/unlinking a file, plus checking if the file mode is set correctly. This exercises umask mask values from octal 0000 to 0777 inclusive. ๐Ÿ’–
  • --umask-ops N โ€” stop after N rounds of exercising umask values 0000 to 0777. slay.

๐Ÿ’œ Umount stressor ๐Ÿ’œ

  • --umount N โ€” start N workers that exercise mounting and racy unmounting of small tmpfs and ramfs file systems. Three child processes get invoked: one to mount, another to force umount, and a third to exercise /proc/mounts. Small random delays are used between mount and umount calls to try to trigger race conditions on the umount calls. so chaotic. ๐Ÿ˜ญ
  • --umount-ops N โ€” stop umount workers after N successful bogo mount/umount operations. ๐ŸŒธ
  • --unlink N โ€” start N workers that each run 4 processes per worker, creating, opening, unlinking and closing 1024 files in randomized order to exercise unlinking (removal) of files. This attempts to create races on file creation, linking and unlinking. pure main character energy. ๐Ÿ‘‘
  • --unlink-ops N โ€” dip out after N bogo rounds of unlink operations on 1024 files by the controlling worker. ๐Ÿ’…

โœจ Unshare stressor (Linux) โœจ

  • --unshare N โ€” spin up N workers, and each one forks off 32 child processes, and each of those kiddos exercises the unshare(2) system call by disassociating parts of the process execution context. (Linux only ๐Ÿง).
  • --unshare-ops N โ€” stop after N bogo unshare operations.

๐Ÿฆ‹ Uprobe stressor (Linux) ๐Ÿฆ‹

  • --uprobe N โ€” start N workers that trace the entry to the libc function getpid(2) using the Linux uprobe kernel tracing mechanism. Heads up bestie, this one needs CAP_SYS_ADMIN capabilities and a modern Linux uprobe capable kernel. no cap, it's giving privileged.
  • --uprobe-ops N โ€” stop uprobe tracing after N trace events of the function that is being traced.

๐ŸŽ€ /dev/urandom stressor (Linux) ๐ŸŽ€

  • -u N, --urandom N โ€” start N workers reading /dev/urandom (Linux only). This will load the kernel random number source. chaos energy fr.
  • --urandom-ops N โ€” stop urandom stress workers after N urandom bogo read operations (Linux only).

๐ŸŒธ Page faults stressor (Linux) ๐ŸŒธ

  • --userfaultfd N โ€” start N workers that generate write page faults on a small anonymously mapped memory region and handle these faults using the user space fault handling via the userfaultfd(2) mechanism. This will generate a large quantity of major page faults and also context switches during the handling of the page faults. (Linux only).
  • --userfaultfd-bytes N โ€” mmap N bytes per userfaultfd worker to page fault on, the default is 16 MB. You can specify the size as % of total available memory, or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g. ๐Ÿ’–
  • --userfaultfd-ops N โ€” stop userfaultfd stress workers after N page faults.

๐Ÿ’€ SIGSYS stressor ๐Ÿ’€

  • --usersyscall N โ€” start N workers that exercise the Linux prctl userspace system call mechanism. A userspace system call is handled by a SIGSYS signal handler and exercised with the system call disabled (ENOSYS) and enabled (via SIGSYS) using prctl PR_SET_SYSCALL_USER_DISPATCH. literally the most unhinged syscall setup and I respect it.
  • --usersyscall-ops N โ€” stop after N successful userspace syscalls via a SIGSYS signal handler.

โญ File timestamp stressor โญ

  • --utime N โ€” start N workers updating file timestamps. This is mainly CPU bound when the default is used, since the system flushes metadata changes only periodically.
  • --utime-fsync โ€” force metadata changes on each file timestamp update to be flushed to disk. This forces the test to become I/O bound and will result in many dirty metadata writes. ๐Ÿ™ˆ
  • --utime-ops N โ€” stop utime stress workers after N utime bogo operations.

๐ŸŒˆ Video for Linux version 2 stressor ๐ŸŒˆ

  • --v4l2 N โ€” start N workers that exercise various v4l2 ioctl commands on all /dev/video devices using valid and invalid arguments.
  • --v4l2-ops N โ€” stop after N v4l2 ioctl bogo operations.

๐Ÿงš Varying load stressor ๐Ÿงš

  • --varyload N โ€” start N workers that vary the system load using 1 to N runnable varyload stressor instances. Depending on the --varyload-type, the number of varyload instances running at any moment of time is changed to scale up or scale down the running load. Varyload instances are temporarily stopped and started by a controlling instance sending SIGSTOP and SIGCONT signals to these processes. ๐Ÿ’…
  • --varyload-ops N โ€” stop after N varyload 1ms bogo cycles
  • --varyload-ms M โ€” vary the load every M milliseconds (from 1 to 3600000 milliseconds). The load is changed based on the --varyload-type option.
  • --varyload-sched P โ€” select the scheduler policy, may be one of batch, deadline, ext, fifo, idle, rr or other.
  • --varyload-method M โ€” select CPU loading method. The available methods are described as follows:
    • all โ€” randomly select any one of all the following methods:
    • fma โ€” perform multiply-add operations, on modern processors these may be compiled into fused-multiply-add instructions.
    • getpid โ€” get the stressor's PID via getpid(2).
    • inc64 โ€” increment a 64 bit integer.
    • memmove โ€” copy (move) a 1 MB buffer using memmove(3).
    • memread โ€” read from a 1 MB buffer using fast memory reads.
    • memset โ€” write to a 1 MB buffer using memset(3).
    • mcw64 โ€” compute 64 bit random numbers using a mwc random generator.
    • nop โ€” waste cycles using no-op instructions.
    • pause โ€” stop execution using CPU pause/yield or memory barrier instructions where available.
    • procname โ€” where possible, change the stressor process name.
    • random โ€” a random mix of all the workload methods, changing the workload method on every spin-loop.
    • strnum โ€” a mix of string to/from numeric conversions, can make x86 systems hot. ๐Ÿ”ฅ
    • sqrt โ€” perform double precision floating point sqrt(3) and hypot(3) math operations.
    • time โ€” get the current time via time(2).
    • vecfp โ€” perform multiplication and addition on a vector of 64 double precision floating point values.
    • vecint โ€” perform multiplication and addition on a vector of 256 unsigned 8 bit integers.
  • --varyload-type T โ€” select the varying load type. The available types are described as follows:
    • all โ€” cycle through all the varyload types, running each type for 20 seconds at a time.
    • brown โ€” repeatedly vary the load using brown noise, using random increment/decrement in load.
    • triangle โ€” repeatedly vary the load from 1 up to N and then down to 1 in increments of 1.
    • saw-inc โ€” repeatedly vary the load from 1 to N in increments of 1 and then directly back down to 1.
    • saw-dec โ€” repeatedly vary the load from N down to 1 in decrements of 1 and then directly back up to N.
    • pulse โ€” repeatedly vary the load directly from 1 to N and then directly back down to 1.
    • random โ€” randomly select load in range 1..N.

๐Ÿ’œ Virtual dynamic shared object stressor ๐Ÿ’œ

  • --vdso N โ€” start N workers that repeatedly call each of the system call functions in the vDSO (virtual dynamic shared object). The vDSO is a shared library that the kernel maps into the address space of all user-space applications to allow fast access to kernel data to some system calls without the need of performing an expensive system call. iconic kernel shortcut behaviour tbh.
  • --vdso-func F โ€” instead of calling all the vDSO functions, just call the vDSO function F. The functions depend on the kernel being used, but are typically clock_gettime(2), getcpu(2), gettimeofday(2) and time(2).
  • --vdso-ops N โ€” stop after N vDSO functions calls.

๐Ÿ“ Vector integer comparison operations stressor ๐Ÿ“

  • --veccmp N โ€” start N workers that perform various unsigned integer math comparison operations on various 128 bit vectors. A mix of integer vector comparison operations is performed on the following vectors: 16 ร— 8 bits, 8 ร— 16 bits, 4 ร— 32 bits, 2 ร— 64 bits, and if supported 1 ร— 128 bits. The metrics produced by this mix depend on the processor architecture and the vector math optimisations produced by the compiler. ๐Ÿซถ
  • --veccmp-ops N โ€” stop after N bogo vector integer comparison operations.

๐Ÿ‘‘ Vector floating point operations stressor ๐Ÿ‘‘

  • --vecfp N โ€” start N workers that exercise floating point (single and double precision) addition, multiplication, division and negation on vectors of 128, 64, 32, 16 and 8 floating point values. The -v option will show the approximate throughput in millions of floating pointer operations per second for each operation. For x86, the gcc/clang target clones attribute has been used to produce vector optimizations for a range of mmx, sse, avx and processor features. โœจ
  • --vecfp-method method โ€” specify a vecfp stress method. By default, all the stress methods are exercised sequentially, however one can specify just one method to be used if required.
  • all โ€” iterate through all of the following vector methods ๐Ÿ’ซ
  • floatv128add โ€” addition of a vector of 128 single precision floating point values
  • floatv64add โ€” addition of a vector of 64 single precision floating point values
  • floatv32add โ€” addition of a vector of 32 single precision floating point values
  • floatv16add โ€” addition of a vector of 16 single precision floating point values
  • floatv8add โ€” addition of a vector of 8 single precision floating point values
  • floatv128mul โ€” multiplication of a vector of 128 single precision floating point values
  • floatv64mul โ€” multiplication of a vector of 64 single precision floating point values
  • floatv32mul โ€” multiplication of a vector of 32 single precision floating point values
  • floatv16mul โ€” multiplication of a vector of 16 single precision floating point values
  • floatv8mul โ€” multiplication of a vector of 8 single precision floating point values
  • floatv128div โ€” division of a vector of 128 single precision floating point values
  • floatv64div โ€” division of a vector of 64 single precision floating point values
  • floatv32div โ€” division of a vector of 32 single precision floating point values
  • floatv16div โ€” division of a vector of 16 single precision floating point values
  • floatv8div โ€” division of a vector of 8 single precision floating point values
  • doublev128add โ€” addition of a vector of 128 double precision floating point values
  • doublev64add โ€” addition of a vector of 64 double precision floating point values
  • doublev32add โ€” addition of a vector of 32 double precision floating point values
  • doublev16add โ€” addition of a vector of 16 double precision floating point values
  • doublev8add โ€” addition of a vector of 8 double precision floating point values
  • doublev128mul โ€” multiplication of a vector of 128 double precision floating point values
  • doublev64mul โ€” multiplication of a vector of 64 double precision floating point values
  • doublev32mul โ€” multiplication of a vector of 32 double precision floating point values
  • doublev16mul โ€” multiplication of a vector of 16 double precision floating point values
  • doublev8mul โ€” multiplication of a vector of 8 double precision floating point values
  • doublev128div โ€” division of a vector of 128 double precision floating point values
  • doublev64div โ€” division of a vector of 64 double precision floating point values
  • doublev32div โ€” division of a vector of 32 double precision floating point values
  • doublev16div โ€” division of a vector of 16 double precision floating point values
  • doublev8div โ€” division of a vector of 8 double precision floating point values
  • doublev128neg โ€” negation of a vector of 128 double precision floating point values
  • doublev64neg โ€” negation of a vector of 64 double precision floating point values
  • doublev32neg โ€” negation of a vector of 32 double precision floating point values
  • doublev16neg โ€” negation of a vector of 16 double precision floating point values
  • doublev8neg โ€” negation of a vector of 8 double precision floating point values

  • --vecfp-ops N โ€” stop after N vector floating point bogo-operations. bestie, one bogo-op = 65536 loops of 2 vector operations โœจ so like, one bogo-op on a 16 wide vector is equivalent to 65536 ร— 2 ร— 16 floating point operations. the math is mathing ๐Ÿ’…

๐Ÿงฎ Vector math operations stressor

  • --vecmath N โ€” start N workers that perform various unsigned integer math operations on various 128 bit vectors. it's giving a whole mix of vector math ops on these vectors: 16 ร— 8 bits, 8 ร— 16 bits, 4 ร— 32 bits, 2 ร— 64 bits and, where supported, 1 ร— 128 bits ๐Ÿ”ฅ ngl the metrics from this mix depend on your processor architecture and on whatever vector math optimisations the compiler cooked up โ€” so results vary, no cap.
  • --vecmath-ops N โ€” stop after N bogo vector integer math operations. ๐Ÿซถ

๐Ÿ”€ Shuffled vector math operations stressor

  • --vecshuf N โ€” start N workers that shuffle data on various 64 byte vectors made up of 8, 16, 32, 64 and 128 bit unsigned integers. the integers get shuffled around the vector with 4 shuffle operations per loop, and 65536 loops make up one bogo-op of shuffling โœจ the data shuffling rates and shuffle operation rates get logged when you use the -v option. this stressor is out here exercising vector load, shuffle/permute, packing/unpacking and store operations. iconic ๐Ÿ’…
  • --vecshuf-method method โ€” pick a vector shuffling stress method. by default all the stress methods get exercised sequentially, but you can specify just one method if you need to, iykyk:
    • all โ€” iterate through all of the following vector methods
    • u8x64 โ€” shuffle a vector of 64 unsigned 8 bit integers
    • u16x32 โ€” shuffle a vector of 32 unsigned 16 bit integers
    • u32x16 โ€” shuffle a vector of 16 unsigned 32 bit integers
    • u64x8 โ€” shuffle a vector of 8 unsigned 64 bit integers
    • u128x4 โ€” shuffle a vector of 4 unsigned 128 bit integers (when supported)
  • --vecshuf-ops N โ€” stop after N bogo vector shuffle ops. one bogo-op is equivalent to 4 ร— 65536 vector shuffle operations on 64 bytes of vector data. slay ๐Ÿฆ‹

๐ŸŒˆ Wide vector math operations stressor

  • --vecwide N โ€” start N workers that perform various 8 bit math operations on vectors of 4, 8, 16, 32, 64, 128, 256, 512, 1024 and 2048 bytes. with the -v option, the relative compute performance vs the expected compute performance based on total run time is shown for the first vecwide worker ๐Ÿ‘€ the vecwide stressor exercises various processor vector instruction mixes and shows how well the compiler can map the vector operations to the target instruction set. it's giving compiler vibe check ๐Ÿ”ฅ
  • --vecwide-ops N โ€” stop after N bogo vector operations (2048 iterations of a mix of vector instruction operations). periodt ๐Ÿ’œ

๐Ÿ›ก๏ธ File based authenticity protection (verity) stressor

  • --verity N โ€” start N workers that exercise read-only file based authenticity protection using the verity ioctls FS_IOC_ENABLE_VERITY and FS_IOC_MEASURE_VERITY. this needs file systems with verity support (currently ext4 and f2fs on Linux) with the verity feature enabled โ€” so like, check that first bestie ๐Ÿ™ˆ the test tries to create a small file with multiple small extents, enables verity on the file and verifies it. it also checks whether the file has verity enabled with the FS_VERITY_FL bit set on the file flags. very demure, very verified โœจ
  • --verity-ops N โ€” stop the verity workers after N file create, enable verity, check verity and unlink cycles. ๐ŸŽ€

๐Ÿด vfork stressor

  • --vfork N โ€” start N workers continually vforking children that immediately exit. bye bestie ๐Ÿ‘‹
  • --vfork-max P โ€” create P processes and then wait for them to exit per iteration. the default is just 1; higher values will create a whole bunch of temporary zombie processes that are waiting to be reaped ๐Ÿ’€ careful tho โ€” one can potentially fill up the process table using high values for --vfork-max and --vfork. not me warning you twice ๐Ÿซถ
  • --vfork-ops N โ€” stop vfork stress workers after N bogo operations.

๐Ÿ’ฅ vfork processes as much as possible stressor

  • --vforkmany N โ€” start N workers that spawn off a chain of vfork children until the process table fills up and/or vfork fails. vfork can rapidly create child processes and the parent process has to wait until the child dies, so this stressor rapidly fills up the process table ๐Ÿ˜ญ like genuinely rapidly. fr fr.
  • --vforkmany-ops N โ€” stop vforkmany stressors after N vforks have been made.
  • --vforkmany-vm โ€” enable detrimental performance virtual memory advice using madvise(2) on all pages of the vforked process. where possible this will try to set every page in the new process using madvise(2) MADV_MERGEABLE, MADV_WILLNEED, MADV_HUGEPAGE and MADV_RANDOM flags. Linux only ๐Ÿง noted.
  • --vforkmany-vm-bytes N โ€” mmap N bytes per vm worker for more memory pressure, the default is 64 MB. this also enables the --vforkmany-vm option. one can specify the size as % of total available memory or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g ๐Ÿ’–

๐Ÿซง Memory allocate and write stressor

  • -m N, --vm N โ€” start N workers continuously calling mmap(2)/munmap(2) and writing to the allocated memory. bestie, note that this can cause systems to trip the kernel OOM killer on Linux systems if not enough physical memory and swap is not available ๐Ÿ˜ญ consider yourself warned, this one has main character energy and it WILL take the whole system down with it ๐Ÿ’€
  • --vm-bytes N โ€” mmap N bytes in total, this is shared by each vm worker, the default is 256 MB. one can specify the size as % of total available memory or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g โœจ adjustable, obsessed ๐Ÿ’…
  • --vm-discontiguous โ€” tries to make the mmap'd physical pages discontiguous by forcing those pages into 'randomly' mixed physical page locations. chaos, but make it memory โœจ
  • --vm-flush โ€” flushes the mapped memory cache after each memory region has been completely written to ๐Ÿ’…
  • --vm-hang N โ€” sleeps for N seconds before unmapping memory. the default is zero seconds. specifying 0 will do an infinite wait ๐Ÿซถ
  • --vm-keep โ€” don't keep un-mapping and mapping the memory over and over, just keep on re-writing to it. lowkey the chill option ๐Ÿ’œ
  • --vm-locked โ€” locks the pages of the mapped region into memory using mmap MAP_LOCKED (since Linux 2.5.37). this is similar to locking memory as described in mlock(2) ๐Ÿ”’
  • --vm-madvise advice โ€” specifies the madvise advice option used on the memory mapped regions that the vm stressor uses. non-linux systems will only have the normal madvise advice; linux systems support collapse, dontneed, hugepage, mergeable, nohugepage, normal, random, sequential, unmergeable and willneed advice. if you don't use this option then the default is to pick the random madvise advice for each mmap call. see madvise(2) for more deets ๐Ÿงš
  • --vm-method method โ€” specifies a vm stress method. by default all the stress methods are exercised sequentially, but you can specify just one method to be used if you need to. each of the vm workers has 3 phases:
    1. Initialised. the anonymously memory mapped region is set to a known pattern ๐ŸŒธ
    2. Exercised. memory is modified in a known predictable way. some vm workers alter memory sequentially, some use small or large strides to step along memory ๐Ÿฆ‹
    3. Checked. the modified memory is checked to see if it matches the expected result โญ

the vm methods with prime in their name have a stride of the largest prime less than 2โ†‘64, which lets them thoroughly step through memory and touch all locations just once while also doing it without touching memory cells next to each other. this strategy exercises the cache and page non-locality. big brain behaviour, honestly ๐Ÿ‘‘

since the memory being exercised is virtually mapped, there's no guarantee of touching page addresses in any particular physical order. these workers should not be used to test that all the system's memory is working correctly either โ€” use tools such as memtest86 instead. periodt ๐Ÿ’€

the vm stress methods are intended to exercise memory in ways that might possibly find memory issues and to try to force thermal errors ๐Ÿ”ฅ

the available vm stress methods are described as follows:

okay bestie, this is the part where it gets juicy โ€” the actual menu of vm stress methods ๐Ÿ’… each one is a different little torture test for your RAM, so let's go down the list, no skips, no cap:

  • all โ€” iterate over all the vm stress methods as listed below. โœจ the "just do everything" option, main character energy fr.
  • cache-lines โ€” work through memory in 64 byte cache sized steps, writing a single byte per cache line. when the write is complete, the memory is read to verify the values are written correctly. ๐ŸŽ€
  • cache-stripe โ€” work through memory in 64 byte cache sized chunks, writing in ascending address order on even offsets and descending address order on odd offsets. lowkey chaotic, highkey effective ๐Ÿฆ‹
  • checkerboard โ€” work through memory writing alternative zero/one bit values into memory in a mixed checkerboard pattern. memory is swapped around to ensure every bit is read, bit flipped and re-written and then re-read for verification. ๐Ÿ‘‘
  • flip โ€” sequentially work through memory 8 times, each time just one bit in memory flipped (inverted). this will effectively invert each byte in 8 passes. ๐Ÿ”ฅ
  • fwdrev โ€” write to even addressed bytes in a forward direction and odd addressed bytes in reverse direction. the contents are sanity checked once all the addresses have been written to. ngl, the name is giving "forward reverse" and it ate ๐Ÿ’€
  • galpat-0 โ€” galloping pattern zeros. this sets all bits to 0 and flips just 1 in 4096 bits to 1. it then checks to see if the 1s are pulled down to 0 by their neighbours or if the neighbours have been pulled up to 1. ๐ŸŽ
  • galpat-1 โ€” galloping pattern ones. this sets all bits to 1 and flips just 1 in 4096 bits to 0. it then checks to see if the 0s are pulled up to 1 by their neighbours or if the neighbours have been pulled down to 0. ๐ŸŽโœจ
  • gray โ€” fill the memory with sequential gray codes (these only change 1 bit at a time between adjacent bytes) and then check if they are set correctly. so satisfying honestly ๐ŸŒธ
  • grayflip โ€” fill memory with adjacent bytes of gray code and inverted gray code pairs to change as many bits at a time between adjacent bytes and check if these are set correctly. ๐Ÿฆ‹
  • incdec โ€” work sequentially through memory twice, the first pass increments each byte by a specific value and the second pass decrements each byte back to the original start value. the increment/decrement value changes on each invocation of the stressor. ๐Ÿ”
  • inc-nybble โ€” initialise memory to a set value (that changes on each invocation of the stressor) and then sequentially work through each byte incrementing the bottom 4 bits by 1 and the top 4 bits by 15. nybble rights!! ๐Ÿ“
  • lfsr32 โ€” fill memory with values generated from a 32 bit Galois linear feedback shift register using the polynomial xโ†‘32 + xโ†‘31 + xโ†‘29 + x + 1. this generates a ring of 2โ†‘32 โˆ’ 1 unique values (all 32 bit values except for 0). literal math icon ๐Ÿงš
  • modulo-x โ€” fill memory over 23 iterations. each iteration starts one byte further along from the start of the memory and steps along in 23 byte strides. in each stride, the first byte is set to a random pattern and all other bytes are set to the inverse. then it checks to see if the first byte contains the expected random pattern. this exercises cache store/reads as well as seeing if neighbouring cells influence each other. ๐ŸŒ€
  • move-inv โ€” sequentially fill memory at 64 bits at a time with random values, and then check if the memory is set correctly. next, sequentially invert each 64 bit pattern and again check if the memory is set as expected. ๐Ÿ™ƒ
  • mscan โ€” fill each bit in each byte with 1s then check these are set, fill each bit in each byte with 0s and check these are clear. simple, clean, slays ๐Ÿ’…
  • one-zero โ€” set all memory bits to one and then check if any bits are not one. next, set all the memory bits to zero and check if any bits are not zero. ๐ŸŽ€
  • prime-0 โ€” iterate 8 times by stepping through memory in very large prime strides, clearing just one bit at a time in every byte. then check to see if all bits are set to zero. primes stay winning ๐Ÿ”ข
  • prime-1 โ€” iterate 8 times by stepping through memory in very large prime strides, setting just one bit at a time in every byte. then check to see if all bits are set to one. ๐Ÿ”ขโœจ
  • prime-gray-0 โ€” first step through memory in very large prime strides, clearing just one bit (based on a gray code) in every byte. next, repeat this but clear the other 7 bits. then check to see if all bits are set to zero. ๐ŸŒˆ
  • prime-gray-1 โ€” first step through memory in very large prime stridesm setting just one bit (based on a gray code) in every byte. next, repeat this but set the other 7 bits. then check to see if all bits are set to one. ๐ŸŒˆโœจ
  • prime-incdec โ€” step through memory in large prime steps incrementing bytes and then re-do again decrementing bytes. ๐Ÿ’ซ
  • rand-set โ€” sequentially work through memory in 64 bit chunks setting bytes in the chunk to the same 8 bit random value. the random value changes on each chunk. check that the values have not changed. ๐ŸŽฒ
  • rand-sum โ€” sequentially set all memory to random values and then summate the number of bits that have changed from the original set values. ๐ŸŽฒ๐Ÿงฎ
  • read64 โ€” sequentially read memory using 32 ร— 64 bit reads per bogo loop. each loop equates to one bogo operation. this exercises raw memory reads. ๐Ÿ‘€
  • ror โ€” fill memory with a random pattern and then sequentially rotate 64 bits of memory right by one bit, then check the final load/rotate/stored values. ๐ŸŒ€
  • rowhammer โ€” try to force memory corruption using the rowhammer memory stressor. this fetches two 32 bit integers from memory and forces a cache flush on the two addresses multiple times. this has been known to force bit flipping on some hardware, especially with lower frequency memory refresh cycles. ๐Ÿ˜ˆ
bestie this one is literally the famous exploit technique โ€” it's designed to corrupt memory on purpose. it's not a bug, it's the whole point. treat it with respect fr.
  • swap โ€” fill memory in 64 byte chunks with random patterns. then swap each 64 chunk with a randomly chosen chunk. finally, reverse the swap to put the chunks back to their original place and check if the data is correct. this exercises adjacent and random memory load/stores. ๐Ÿ”„
  • walk-0a โ€” in the given memory mapping, work through a range of specially chosen addresses working through address lines to see if any address lines are stuck low. this works best with physical memory addressing, however, exercising these virtual addresses has some value too. ๐Ÿšถโ€โ™€๏ธ
  • walk-0d โ€” for each byte in memory, walk through each data line setting them to low (and the others are set high) and check that the written value is as expected. this checks if any data lines are stuck. ๐Ÿšถโ€โ™€๏ธ
  • walk-1a โ€” in the given memory mapping, work through a range of specially chosen addresses working through address lines to see if any address lines are stuck high. this works best with physical memory addressing, however, exercising these virtual addresses has some value too. ๐Ÿšถโ€โ™€๏ธโœจ
  • walk-1d โ€” for each byte in memory, walk through each data line setting them to high (and the others are set low) and check that the written value is as expected. this checks if any data lines are stuck. ๐Ÿšถโ€โ™€๏ธโœจ
  • walk-flush โ€” walk through memory a byte at a time writing/flushing/reading 8 bytes of incrementing 8 bit data. for architectures that support user space cache flushing this will cause high data cache miss rates. ๐Ÿ’จ
  • write64 โ€” sequentially write to memory using 32 ร— 64 bit writes per bogo loop. each loop equates to one bogo operation. this exercises raw memory writes. note that memory writes are not checked at the end of each test iteration. โœ๏ธ
ok so that last bit matters โ€” write64 doesn't verify its work, it just writes and dips. so don't go expecting it to catch anything, iykyk ๐Ÿซถ
  • write64ds โ€” writes to memory sequentially using 32 ร— 64 bit direct store writes per bogo loop. Each loop = one bogo operation. This one exercises the cacheless write combining (WC) memory type protocol for memory writes, and it's only available on x86 systems with the movediri instruction, built with gcc and clang compilers. Heads up: memory writes are not checked at the end of each test iteration. ๐Ÿ’…
  • write64nt โ€” writes to memory sequentially using 32 ร— 64 bit non-temporal writes per bogo loop. Each loop = one bogo operation. Exercises cacheless raw memory writes, only available on x86 sse2 capable systems built with gcc and clang compilers. Same warning bestie: memory writes are not checked at the end of each test iteration.
  • write1024v โ€” writes to memory sequentially using 1 ร— 1024 bit vector write per bogo loop (only available if the compiler supports vector types, iykyk). Each loop = one bogo operation. This one exercises raw memory writes. And yep โ€” memory writes are not checked at the end of each test iteration. ๐Ÿ˜ญ
  • wrrd128nt โ€” writes to memory in 128 bit chunks using non-temporal writes (aka straight up bypassing the cache โœจ). Each chunk gets written 4 times to hammer the memory. Then it checks if the data is correct using non-temporal reads if they're available, or normal memory reads if not. Only available with processors that provide non-temporal 128 bit writes.
  • zero-one โ€” sets all memory bits to zero, then checks if any bits aren't zero. Then sets all the memory bits to one and checks if any bits aren't one. Simple. Iconic. ๐ŸŽ€
  • --vm-nt โ€” uses non-temporal stores and loads for 64 bit and 128 bit memory writes and reads. Disabled for systems that don't support x86 non-temporal memory operations (in which case normal stores and loads are used instead). No cap.
  • --vm-numa โ€” assigns memory mapped pages to randomly selected NUMA nodes. Disabled for systems that don't support NUMA. ๐Ÿฆ‹
  • --vm-ops N โ€” stops vm workers after N bogo operations.
  • --vm-populate โ€” populates (prefaults) page tables for the memory mappings; this can stress swapping. Only available on systems that support MAP_POPULATE (since Linux 2.5.46). โญ

๐ŸŒˆ Virtual memory addressing stressor ๐ŸŒˆ

  • --vm-addr N โ€” starts N workers that exercise virtual memory addressing using various methods to walk through a memory mapped address range. This exercises mapped private addresses from 8 MB to 64 MB per worker and tries to generate cache and TLB inefficient addressing patterns. Each method sets the memory to a random pattern in a write phase and then sanity checks it in a read phase. ๐Ÿงš
  • --vm-addr-method method โ€” specifies a vm address stress method. By default, all the stress methods are exercised sequentially, but you can specify just one method to be used if you need to. ๐Ÿ’–

The available vm address stress methods are described as follows, bestie:

  • all โ€” iterate over all the vm stress methods as listed below.
  • bitposn โ€” iteratively write to memory in powers of 2 strides of max_stride to 1 and then read check memory in powers of 2 strides 1 to max_stride, where max_stride is half the size of the memory mapped region. All bit positions of the memory address space are bit flipped in the striding. ๐Ÿ”ฅ
  • dec โ€” work through the address range backwards sequentially, byte by byte.
  • decinv โ€” like dec, but with all the relevant address bits inverted.
  • flip โ€” address memory using gray coded addresses and their inverse to flip as many address bits per write/read operation.
  • gray โ€” work through memory with gray coded addresses so that each change of address just changes 1 bit compared to the previous address. โœจ
  • grayinv โ€” like gray, but with all relevant address bits inverted, hence all bits change apart from 1 in the address range.
  • inc โ€” work through the address range forwards sequentially, byte by byte.
  • incinv โ€” like inc, but with all the relevant address bits inverted.
  • pwr2 โ€” work through memory addresses in steps of powers of two.
  • pwr2inv โ€” like pwr2, but with all the relevant address bits inverted.
  • rev โ€” work through the address range with the bits in the address range reversed.
  • revinv โ€” like rev, but with all the relevant address bits inverted.
  • --vm-addr-mlock โ€” attempts to mlock(2) pages into memory, causing more memory pressure by preventing pages from being swapped out. ๐Ÿ‘‘
  • --vm-addr-numa โ€” assigns memory mapped pages to randomly selected NUMA nodes. Disabled for systems that don't support NUMA.
  • --vm-addr-ops N โ€” stops N workers after N bogo addressing passes.

๐Ÿ’œ Memory transfer between parent and child processes stressor (Linux) ๐Ÿ’œ

  • --vm-rw N โ€” starts N workers that transfer memory to/from a parent/child using process_vm_writev(2) and process_vm_readv(2). This feature is only supported on Linux. Memory transfers are only verified if the --verify option is enabled. ๐Ÿซถ
  • --vm-rw-bytes N โ€” mmap N bytes per vm-rw worker, the default is 16 MB. You can specify the size as % of total available memory or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g.
  • --vm-rw-ops N โ€” stops vm-rw workers after N memory read/writes.

๐ŸŒธ Memory unmap from a child process stressor ๐ŸŒธ

  • --vm-segv N โ€” starts N workers that create a child process that unmaps its address space, causing a SIGSEGV on return from the unmap. ๐Ÿ’€
  • --vm-segv-ops N โ€” stops after N bogo vm-segv SIGSEGV faults.

๐Ÿ“ Vmsplice stressor (Linux) ๐Ÿ“

  • --vm-splice N โ€” moves data from memory to /dev/null through a pipe without any copying between kernel address space and user address space, using vmsplice(2) and splice(2). This is only available for Linux. โœจ
  • --vm-splice-bytes N โ€” transfers N bytes per vmsplice call, the default is 64 K. You can specify the size as % of total available memory or in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g.
  • --vm-splice-ops N โ€” stops after N bogo vm-splice operations.

๐Ÿฆ‹ Virtual Memory Area (VMA) stressor ๐Ÿฆ‹

  • --vma N โ€” starts M workers that create pthreads to mmap(2), munmap(2), mlock(2), munlock(2), madvise(2), msync(2), mprotect(2), mincore(2) and access 32 pages in a randomly selected virtual memory address space. This is designed to trip races on VMA page modifications. Every 15 seconds a different virtual address space is randomly chosen. ๐Ÿ˜ค
  • --vma-ops N โ€” stops the vma stressors after N successful memory mappings.

๐Ÿ‘‘ Vector neural network instructions stressor ๐Ÿ‘‘

  • --vnni N โ€” starts N workers that exercise vector neural network instructions (VNNI) used in convolutional neural network loops. A 256 byte vector is operated upon using 8 bit multiply with 16 bit summation, 16 bit multiply and 32 bit summation, and 8 bit summation. When processor features allow, these operations use 512, 256 and 128 bit vector operations. Generic non-vectorized code variants are also provided (which may be vectorized by more advanced optimising compilers). ๐Ÿ”ฅ
  • --vnni-intrinsic โ€” just use the vnni methods that use intrinsic VNNI instructions and ignore the generic non-vectorized methods.
  • --vnni-method N โ€” select the VNNI method to be exercised, may be one of:
  • all โ€” exercise all the following VNNI methods, the whole lineup ๐Ÿ’…
  • vpaddb512 โ€” 8 bit vector addition using 512 bit vector operations on 64 ร— 8 bit integers, (x86 vpaddb)
  • vpaddb256 โ€” 8 bit vector addition using 256 bit vector operations on 32 ร— 8 bit integers, (x86 vpaddb)
  • vpaddb128 โ€” 8 bit vector addition using 128 bit vectors operations on 32 ร— 8 bit integers, (x86 vpaddb)
  • vpaddb โ€” 8 bit vector addition using 8 bit sequential addition (may be vectorized by the compiler)
  • vpdpbusd512 โ€” 8 bit vector multiplication of unsigned and signed 8 bit values followed by 16 bit summation using 512 bit vector operations on 64 ร— 8 bit integers, (x86 vpdpbusd)
  • vpdpbusd256 โ€” 8 bit vector multiplication of unsigned and signed 8 bit values followed by 16 bit summation using 256 bit vector operations on 32 ร— 8 bit integers, (x86 vpdpbusd)
  • vpdpbusd128 โ€” 8 bit vector multiplication of unsigned and signed 8 bit values followed by 16 bit summation using 128 bit vector operations on 32 ร— 8 bit integers, (x86 vpdpbusd)
  • vpdpbusd โ€” 8 bit vector multiplication of unsigned and signed 8 bit values followed by 16 bit summation using sequential operations (may be vectorized by the compiler)
  • vpdpwssd512 โ€” 16 bit vector multiplication of unsigned and signed 16 bit values followed by 32 bit summation using 512 bit vector operations on 64 ร— 8 bit integers, (x86 vpdpwssd)
  • vpdpwssd256 โ€” 16 bit vector multiplication of unsigned and signed 16 bit values followed by 32 bit summation using 256 bit vector operations on 64 ร— 8 bit integers, (x86 vpdpwssd)
  • vpdpwssd128 โ€” 16 bit vector multiplication of unsigned and signed 16 bit values followed by 32 bit summation using 128 bit vector operations on 64 ร— 8 bit integers, (x86 vpdpwssd)
  • vpdpwssd โ€” 16 bit vector multiplication of unsigned and signed 16 bit values followed by 32 bit summation using sequential operations (may be vectorized by the compiler)

  • --vnni-ops N โ€” stop after N bogo VNNI computation operations. Just so you know what a bogo-op is here ๐Ÿ‘€ 1 bogo-op is equivalent to 1024 convolution loops operating on 256 bytes of data. That's a chunky unit bestie, fr fr.

๐Ÿ’ค Pausing and resuming threads stressor ๐Ÿ’ค

  • --wait N โ€” start N workers that spawn off two children; one spins in a pause(2) loop, the other continually stops and continues the first. The controlling process waits on the first child to be resumed by the delivery of SIGCONT using waitpid(2) and waitid(2). Literally a whole stop-and-go situationship between two processes ๐Ÿ˜ญ
  • --wait-ops N โ€” stop after N bogo wait operations.

โธ๏ธ CPU wait instruction stressor โธ๏ธ

  • --waitcpu N โ€” start N workers that exercise processor wait instructions. Per-architecture tea โ˜•:
    • For x86 these are pause, tpause and umwait (when available) and nop.
    • For ARM the yield instruction is used.
    • For PPC64 the yield, mdoio and mdooom instructions are used.
    • For RISC-V the pause instruction is used.
    • For Loong64 the dbar instruction is used.
    • For openRISC the psync instruction is used.
    • For other architectures no-op instructions are used.
  • --waitcpu-ops N โ€” stop after N bogo processor wait operations.

๐Ÿ• Watchdog stressor ๐Ÿ•

  • --watchdog N โ€” start N workers that exercise the /dev/watchdog watchdog interface by opening it, perform various watchdog specific ioctl(2) commands on the device and close it. Before closing the special watchdog magic close message is written to the device to try and force it to never trip a watchdog reboot after the stressor has been run. Cute, right? It's literally telling the dog "stay, bestie, don't reset the machine" ๐Ÿซถ
Note that this stressor needs to be run as root with the --pathological option and is only available on Linux. No exceptions, no cap ๐Ÿ’€
  • --watchdog-ops N โ€” stop after N bogo operations on the watchdog device.

๐ŸŒธ Libc wide characterstring function stressor ๐ŸŒธ

  • --wcs N โ€” start N workers that exercise various libc wide character string functions on random strings. Chaos strings, iconic behaviour โœจ
  • --wcs-method wcsfunc โ€” select a specific libc wide character string function to stress. Available string functions to stress are: all, wcscasecmp, wcscat, wcschr, wcscoll, wcscmp, wcscpy, wcslen, wcsncasecmp, wcsncat, wcsncmp, wcsrchr and wcsxfrm. The all method is the default and will exercise all the string methods. Pick your fighter ๐Ÿ’…
  • --wcs-ops N โ€” stop after N bogo wide character string operations.

๐Ÿ—“๏ธ scheduler workload stressor ๐Ÿ—“๏ธ

  • --workload N โ€” start N workers that exercise the scheduler with items of work that are started at random times with random sleep delays between work items. By default a 100000 microsecond slice of time has 100 work items that start at random times during the slice. The work items by default run for a quanta of 1000 microseconds scaled by the percentage work load (default of 30%). For a slice of S microseconds and a work item quanta duration of Q microseconds, S / Q work items are executed per slice. For a work load of L percent, the run time per item is the quanta Q ร— L / 100 microseconds. The --workload-threads option allows work items to be taken from a queue and run concurrently if the scheduling run times overlap.

If a work item is already running when a new work item is scheduled to run then the new work item is delayed and starts directly after the completion of the currently running work item when running with the default of zero worker threads. This emulates bursty scheduled compute, such as handling input packets where one may have lots of work items bunched together or with random unpredictable delays between work items. It's giving "network traffic at 3am" energy ngl ๐Ÿ“ฆ

  • --workload-load L โ€” specify the percentage run time load of each work item with respect to the run quanta duration. Essentially the run duration of each work item is the quanta duration Q ร— L / 100. Math girlies rise ๐Ÿ™Œ
  • --workload-method method โ€” select the workload method. Each quanta of execution time is consumed using a tight spin-loop executing a workload method. The available methods are described as follows:
    • all โ€” randomly select any one of all the following methods:
    • fma โ€” perform multiply-add operations, on modern processors these may be compiled into fused-multiply-add instructions.
    • getpid โ€” get the stressor's PID via getpid(2).
    • inc64 โ€” increment a 64 bit integer.
    • memmove โ€” copy (move) a 1 MB buffer using memmove(3).
    • memread โ€” read from a 1 MB buffer using fast memory reads.
    • memset โ€” write to a 1 MB buffer using memset(3).
    • mcw64 โ€” compute 64 bit random numbers using a mwc random generator.
    • nop โ€” waste cycles using no-op instructions.
    • pause โ€” stop execution using CPU pause/yield or memory barrier instructions where available.
    • procname โ€” where possible, change the stressor process name.
    • random โ€” a random mix of all the workload methods, changing the workload method on every spin-loop.
    • strnum โ€” a mix of string to/from numeric conversions, can make x86 systems hot. ๐Ÿ”ฅ Fr fr, watch those temps.
    • sqrt โ€” perform double precision floating point sqrt(3) and hypot(3) math operations.
    • time โ€” get the current time via time(2).
    • vecfp โ€” perform multiplication and addition on a vector of 64 double precision floating point values.
    • vecint โ€” perform multiplication and addition on a vector of 256 unsigned 8 bit integers.
  • --workload-sched [ batch | deadline | ext | fifo | idle | other | rr ] โ€” select scheduling policy. Note that deadline, fifo and rr require root privilege. The audacity of permissions, honestly ๐Ÿ˜ค
  • --workload-slice-us S โ€” specify the duration of each scheduling slice in microseconds. The default is 100000 microseconds (0.1 seconds).
  • --workload-quanta-us Q โ€” specify the duration of each work item in microseconds. The default is 1000 microseconds (1 millisecond).
  • --workload-threads N โ€” use N process threads to take scheduler work items of a workqueue and run the work item (default is 2). When N is 0, no threads are used and the work items are run back-to-back sequentially without using a work queue. Using more than 2 threads allows work items to be handled concurrently if enough idle processors are available. More threads = more main character energy ๐Ÿงš
  • --workload-dist [ cluster | even | poisson | random1 | random2 | random3 ] โ€” specify the scheduling distribution of work items, the default is cluster. The distribution methods are described as follows:
  • cluster โ€” cluster 2/3 of the start times to try to start at the random time during the time slice, with the other 1/3 of start times evenly randomly distributed using a single random variable. The clustered start times cause a burst of items to be scheduled in a bunch with no delays between each clustered work item. ๐Ÿ’…
  • even โ€” evenly distribute scheduling start times across the workload slice โœจ
  • poisson โ€” generate scheduling events that occur individually at random moments, but which tend to occur at an average rate (known as a Poisson process). ๐ŸŽ€
  • random1 โ€” evenly randomly distribute scheduling start times using a single random variable.
  • random2 โ€” randomly distribute scheduling start times using a sum of two random variables, much like throwing 2 dice. ๐ŸŽฒ
  • random3 โ€” randomly distribute scheduling start times using a sum of three random variables, much like throwing 3 dice. ๐ŸŽฒ๐ŸŽฒ
  • --workload-ops N โ€” stop the workload workers after N workload bogo-operations. ๐Ÿ›‘

๐Ÿงš x86 cpuid stressor

  • --x86cpuid N โ€” start N workers that exercise the x86 cpuid instruction with 18 different leaf types. eighteen!! that's so many leaves bestie ๐Ÿƒ
  • --x86cpuid-ops N โ€” stop after N iterations that exercise the different cpuid leaf types.

๐Ÿง x86-64 syscall stressor (Linux)

  • --x86syscall N โ€” start N workers that repeatedly exercise the x86-64 syscall instruction to call the getcpu(2), geteuid(2), getgid(2), getpid(2), gettimeofday(2) and time(2) system calls using the Linux vsyscall handler. Only for Linux, obviously ๐Ÿ’…
  • --x86syscall-func F โ€” Instead of exercising the 6 syscall system calls, just call the syscall function F. The function F must be one of getcpu, geteuid, getgid, getpid, gettimeofday or time.
  • --x86syscall-ops N โ€” stop after N x86syscall system calls.

๐Ÿฆ‹ Extended file attributes stressor

  • --xattr N โ€” start N workers that create, update and delete batches of extended attributes on a file. little attribute glow-ups, slay โœจ
  • --xattr-ops N โ€” stop after N bogo extended attribute operations.

๐ŸŒธ Yield scheduling stressor

  • -y N, --yield N โ€” start N workers that call sched_yield(2). This stressor ensures that at least 2 child processes per CPU exercise shield_yield(2) no matter how many workers are specified, thus always ensuring rapid context switching. (yes, shield_yield โ€” that's literally what the page says, i don't make the rules ๐Ÿซถ)
  • --yield-ops N โ€” stop yield stress workers after N sched_yield(2) bogo operations.
  • --yield-procs N โ€” specify the number of child processes to run per stressor instance. The default is 2, range 1 to 65536.
  • --yield-sched [ batch | deadline | ext | fifo | idle | other | rr ] โ€” select scheduling policy. Note that deadline, fifo and rr require root privilege. ๐Ÿ‘‘ (root energy only, bestie)

๐Ÿ’€ /dev/zero stressor

  • --zero N โ€” start N workers that exercise /dev/zero with read(2), lseek(2), ioctl(2) and mmap(2) calls. For just /dev/zero read benchmarking use the --zero-read option.
  • --zero-ops N โ€” stop zero stress workers after N /dev/zero bogo read operations.
  • --zero-read โ€” just read /dev/zero with 4 K reads with no additional exercising on /dev/zero.

๐Ÿ“ Zlib stressor

  • --zlib N โ€” start N workers compressing and decompressing random data using zlib. Each worker has two processes, one that compresses random data and pipes it to another process that decompresses the data. This stressor exercises CPU, cache and memory. squish and unsquish, iconic ๐Ÿ”ฅ
  • --zlib-level L โ€” specify the compression level (0..9), where 0 = no compression, 1 = fastest compression and 9 = best compression.
  • --zlib-mem-level L โ€” specify the reserved compression state memory for zlib. The default is 8.
    • Value 1 โ€” minimum memory usage.
    • Value 9 โ€” maximum memory usage.
  • --zlib-method method โ€” specify the type of random data to send to the zlib library. By default, the data stream is created from a random selection of the different data generation processes. However one can specify just one method to be used if required. Available zlib data generation methods are described as follows: ๐Ÿ‘‡
    • 00ff โ€” randomly distributed 0x00 and 0xFF values.
    • ascii01 โ€” randomly distributed ASCII 0 and 1 characters.
    • asciidigits โ€” randomly distributed ASCII digits in the range of 0 and 9.
    • bcd โ€” packed binary coded decimals, 0..99 packed into 2 4-bit nybbles.
    • binary โ€” 32 bit random numbers.
    • brown โ€” 8 bit brown noise (Brownian motion/Random Walk noise).
    • double โ€” double precision floating point numbers from sin(ฮธ).
    • fixed โ€” data stream is repeated 0x04030201.
    • gcr โ€” random values as 4 ร— 4 bit data turned into 4 ร— 5 bit group coded recording (GCR) patterns. Each 5 bit GCR value starts or ends with at most one zero bit so that concatenated GCR codes have no more than two zero bits in a row.
    • gray โ€” 16 bit gray codes generated from an incrementing counter.
    • inc16 โ€” 16 bit incrementing values starting from a random 16 bit value.
    • latin โ€” Random latin sentences from a sample of Lorem Ipsum text.
    • lehmer โ€” Fast random values generated using Lehmer's generator using a 128 bit multiply.
    • lfsr32 โ€” Values generated from a 32 bit Galois linear feedback shift register using the polynomial xโ†‘32 + xโ†‘31 + xโ†‘29 + x + 1. This generates a ring of 2โ†‘32 โˆ’ 1 unique values (all 32 bit values except for 0).
    • logmap โ€” Values generated from a logistical map of the equation ฮงn+1 = r ร— ฮงn ร— (1 โˆ’ ฮงn) where r > โˆผ 3.56994567 to produce chaotic data. The values are scaled by a large arbitrary value and the lower 8 bits of this value are compressed.
    • lrand48 โ€” Uniformly distributed pseudo-random 32 bit values generated from lrand48(3).
    • morse โ€” Morse code generated from random latin sentences from a sample of Lorem Ipsum text.
    • nybble โ€” randomly distributed bytes in the range of 0x00 to 0x0f.
    • objcode โ€” object code selected from a random start point in the stress-ng text segment.
    • parity โ€” 7 bit binary data with 1 parity bit.
    • pink โ€” pink noise in the range 0..255 generated using the Gardner method with the McCartney selection tree optimization. Pink noise is where the power spectral density is inversely proportional to the frequency of the signal and hence is slightly compressible. ๐ŸŽ€
    • random โ€” segments of the data stream are created by randomly calling the different data generation methods.
    • rarely1 โ€” data that has a single 1 in every 32 bits, randomly located.
    • rarely0 โ€” data that has a single 0 in every 32 bits, randomly located.
    • rdrand โ€” generate random data using rdrand instruction (x86) or use 64 bit mwc pseudo-random number generator for non-x86 systems.
    • ror32 โ€” generate a 32 bit random value, rotate it right 0 to 7 places and store the rotated value for each of the rotations.
    • text โ€” random ASCII text.
    • utf8 โ€” random 8 bit data encoded to UTF-8.
    • zero โ€” all zeros, compresses very easily. ๐Ÿ’ค
  • --zlib-ops N โ€” stop after N bogo compression operations, each bogo compression operation is a compression of 64 K of random data at the highest compression level.
  • --zlib-strategy S โ€” specifies the strategy to use when deflating data. This is used to tune the compression algorithm. The default is 0.
    • Value 0 โ€” used for normal data (Z_DEFAULT_STRATEGY).
    • Value 1 โ€” for data generated by a filter or predictor (Z_FILTERED)
    • Value 2 โ€” forces huffman encoding (Z_HUFFMAN_ONLY).
    • Value 3 โ€” Limit match distances to one run-length-encoding (Z_RLE).
    • Value 4 โ€” prevents dynamic huffman codes (Z_FIXED).
  • --zlib-stream-bytes S โ€” specify the amount of bytes to deflate until deflate should finish the block and return with Z_STREAM_END. One can specify the size in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g. The default is 0 which creates an endless stream until the stressor ends. ๐ŸŒŠ
    • Value 0 โ€” creates an endless deflate stream until the stressor stops.
    • Value n โ€” creates a stream of n bytes over and over again. Each block will be closed with Z_STREAM_END.
  • --zlib-window-bits W โ€” sets the window bits, which is how you tell zlib the size of its history buffer ๐Ÿ’… the value is the base-two logarithm of the buffer size (so like, value 9 means 2โ†‘9 = 512 bytes, math queen). default is 15.

The values are giving:

  • -8โ€“-15 โ€” raw deflate format.
  • 8โ€“15 โ€” zlib format.
  • 24โ€“31 โ€” gzip format.
  • 40โ€“47 โ€” inflate auto format detection using zlib deflate format.

๐ŸงŸ Zombie processes stressor ๐ŸงŸ

  • --zombie N โ€” starts N workers that literally create zombie processes ๐Ÿ‘ป it will rapidly try to create a default of 8192 child processes that immediately die and then wait in a zombie state until they get reaped. When the max number of processes is reached (or fork fails because one has hit the maximum allowed number of children), the oldest child gets reaped and a new process is created in a first-in first-out manner, and then it just repeats. iconic behaviour, honestly.
  • --zombie-clone โ€” uses clone(2) instead of fork(2) to create the zombie processes (Linux only ๐Ÿง). If you run it with CAP_SYS_ADMIN then the processes are created with new cgroup, ipc, net, mount and PID namespaces, and namespace leakage gets exercised with the creation of a new mount and socket. very main character of it.
  • --zombie-max N โ€” tries to create as many as N zombie processes. heads up tho: this may not be reached if the system limit is less than N ๐Ÿ˜ญ
  • --zombie-ops N โ€” stops the zombie stress workers after N bogo zombie operations.

โœจ EXAMPLES โœจ

okay bestie, this is the good part, the actual recipes ๐Ÿ“

stress-ng --vm 8 --vm-bytes 80% -t 1h

run 8 virtual memory stressors that combined use 80% of the available memory for 1 hour. so each stressor uses 10% of the available memory. math checks out ๐Ÿ’–

stress-ng --vm 50% -t 1h

run virtual memory stressors on 50% of the number of online CPUs for 1 hour.

stress-ng --vm 200% -t 1h

run virtual memory stressors on 2 times the number of online CPUs for 1 hour.

stress-ng --cpu 4 --io 2 --vm 1 --vm-bytes 1G --timeout 60s

runs for 60 seconds with 4 CPU stressors, 2 io stressors and 1 vm stressor using 1 GB of virtual memory. a lil balanced plate ๐ŸŽ€

stress-ng --iomix 2 --iomix-bytes 10% -t 10m

runs 2 instances of the mixed I/O stressors using a total of 10% of the available file system space for 10 minutes. each stressor will use 5% of the available file system space.

stress-ng --with cpu,matrix,vecmath,fp --seq 8 -t 1m

run 8 instances of cpu, matrix, vecmath and fp stressors sequentially one after another, for 1 minute per stressor.

stress-ng --trig 25% --fp 50% --fma 25% -t 5m --verify

run trigonometric function stressor on 25% of the online CPUs, floating point stressor on 50% of the online CPUs and fused-multiple-add stressor on 25% of the online CPUs for 5 minutes and enable verification of results. slay, verified ๐Ÿ’…

stress-ng --with cpu,matrix,vecmath,fp --permute 5 -t 10s

run permutations of 5 instances of cpu, matrix, vecmath and fp stressors sequentially one after another, for 10 seconds per permutation mix.

stress-ng --cyclic 1 --cyclic-dist 2500 --cyclic-method clock_ns
--cyclic-prio 100 --cyclic-sleep 10000 --hdd 0 -t 1m

measures real time scheduling latencies created by the hdd stressor. this uses the high resolution nanosecond clock to measure latencies during sleeps of 10000 nanoseconds. at the end of 1 minute of stressing, the latency distribution with 2500 ns intervals will be displayed. NOTE: this must be run with the CAP_SYS_NICE capability to enable the real time scheduling to get accurate measurements. no cap, you need the capability ๐Ÿ”ฅ

stress-ng --cpu 8 --cpu-ops 800000

runs 8 cpu stressors and stops after 800000 bogo operations.

stress-ng --sequential 2 --timeout 2m --metrics

run 2 simultaneous instances of all the stressors sequentially one by one, each for 2 minutes and summarise with performance metrics at the end.

stress-ng --cpu 4 --cpu-method fft --cpu-ops 10000 --metrics-brief

run 4 FFT cpu stressors, stop after 10000 bogo operations and produce a summary just for the FFT results.

stress-ng --cpu -1 --cpu-method all -t 1h --cpu-load 90

run cpu stressors on all online CPUs working through all the available CPU stressors for 1 hour, loading the CPUs at 90% load capacity.

stress-ng --cpu 0 --cpu-method all -t 20m

run cpu stressors on all configured CPUs working through all the available CPU stressors for 20 minutes

stress-ng --all 4 --timeout 5m

run 4 instances of all the stressors for 5 minutes. everything, everywhere, all at once ๐Ÿฆ‹

stress-ng --random 64

run 64 stressors that are randomly chosen from all the available stressors. chaos, but make it scheduled โœจ

stress-ng --cpu 64 --cpu-method all --verify -t 10m --metrics-brief

run 64 instances of all the different cpu stressors and verify that the computations are correct for 10 minutes with a bogo operations summary at the end.

stress-ng --sequential -1 -t 10m

run all the stressors one by one for 10 minutes, with the number of instances of each stressor matching the number of online CPUs.

stress-ng --sequential 8 --class io -t 5m --times

run all the stressors in the io class one by one for 5 minutes each, with 8 instances of each stressor running concurrently and show overall time utilisation statistics at the end of the run.

stress-ng --class io\?

show all the stressors in the io class

sudo stress-ng --class scheduler --seq 0 -t 1m --taskset-random
--progress --klog-check

run all the scheduler exercising stressors sequentially on all online CPUs for 1 minute per stressor type, frequently changing the CPUs that the processes are running on, show progress and report any detected kernel issues. sudo era ๐Ÿ™ˆ

stress-ng --all -1 --maximize --aggressive

run all the stressors (1 instance of each per online CPU) simultaneously, maximize the settings (memory sizes, file allocations, etc.) and select the most demanding/aggressive options. bestie this is the boss fight ๐Ÿ’€

stress-ng --all 8 --with cpu,hash,nop,vm --timeout 1m

run 8 instances of cpu, hash, nop and vm stressors altogether for 1 minute.

stress-ng --seq 8 --with cpu,hash,nop,vm --timeout 1m --progress

run 8 instances of cpu, hash, nop and vm stressors one after another for 1 minute each and show the run progress.

stress-ng --random 32 -x numa,hdd,key

run 32 randomly selected stressors and exclude the numa, hdd and key stressors

stress-ng --sequential 4 --class vm --exclude bigheap,brk,stack

run 4 instances of the VM stressors one after another, excluding the bigheap, brk and stack stressors

stress-ng --taskset 0,2-3 --cpu 3

run 3 instances of the CPU stressor and pin them to CPUs 0, 2 and 3.

stress-ng --taskset odd --cpu 32

run 32 instances of the CPU stressor and pin them to odd numbered CPUs.

stress-ng --exercise-feature memory-copy,memory-cmp --seq 1 -t 10

run 1 instance of all stressors (for 10 seconds each) that are known exercise memory copies and memory comparisons.

stress-ng --exercise-syscall select,poll --all 4 -t 60

run 4 instances of all stressors that exercise select and poll system calls.

stress-ng --exercise-syscall \?

report the system calls used by all stressors.

๐Ÿšฆ EXIT STATUS ๐Ÿšฆ

like a vibe check but for how the run went ๐Ÿ‘‘

  • 0 โ€” Success. we love to see it ๐Ÿ’–
  • 1 โ€” Error; incorrect user options or a fatal resource issue in the stress-ng stressor harness (for example, out of memory).
  • 2 โ€” One or more stressors failed.
  • 3 โ€” One or more stressors failed to initialise because of lack of resources, for example ENOMEM (no memory), ENOSPC (no space on file system) or a missing or unimplemented system call.
  • 4 โ€” One or more stressors were not implemented on a specific architecture or operating system.
  • 5 โ€” A stressor has been killed by an unexpected signal.
  • 6 โ€” A stressor exited by exit(2) which was not expected and timing metrics could not be gathered.
  • 7 โ€” The bogo ops metrics may be untrustworthy. this is most likely to occur when a stress test is terminated during the update of a bogo-ops counter such as when it has been OOM killed. a less likely reason is that the counter ready indicator has been corrupted. not me trusting the numbers when they're lying ๐Ÿ˜ญ

๐Ÿ› BUGS ๐Ÿ›

file bug reports at: https://github.com/ColinIanKing/stress-ng/issues โ€” please note that no support will be provided if stress-ng is packaged without this manual. so like, keep the manual, it's part of the set ๐ŸŽ€

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

cpuburn(1), perf(1), stress(1), taskset(1)

https://github.com/ColinIanKing/stress-ng/blob/master/README.md

๐Ÿ’œ AUTHOR ๐Ÿ’œ

stress-ng was written by Colin Ian King <colin.i.king@gmail.com> and is a clean room re-implementation and extension of the original stress tool by Amos Waterland. thanks also to the many contributors to stress-ng. the README.md file in the source contains a full list of the contributors. the way this manpage has lore ๐Ÿซถ

stress-ng is free and will always be free. sponsoring the project is a great way to help pay for the running costs (hardware, power, etc) to support the development process.

Sponsorship link: https://github.com/sponsors/ColinIanKing

๐Ÿ“ NOTES ๐Ÿ“

  • sending a SIGALRM, SIGINT or SIGHUP to stress-ng causes it to terminate all the stressor processes and ensures temporary files and shared memory segments are removed cleanly. clean exit, hydrated, moisturized โœจ
  • sending a SIGUSR2 to stress-ng will dump out the current load average and memory statistics.
  • note that the stress-ng cpu, io, vm and hdd tests are different implementations of the original stress tests and hence may produce different stress characteristics. different, not wrong ๐Ÿ’…
  • the bogo operations metrics may change with each release because of bug fixes to the code, new features, compiler optimisations, changes in support libraries or system call performance.

Copyright ยฉ 2013-2021 Canonical Ltd, Copyright ยฉ 2021-2026 Colin Ian King. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


and that's the whole page bestie, you made it to the end ๐ŸŽ€ source is STRESS-NG(1), dated 2 November 2026 โ€” go stress something responsibly, mwah ๐Ÿ’–๐ŸŒธ

๐Ÿ“ฆ where this page comes from