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โ startNinstances of all stressors in parallel. IfNis less than zero, then the number of CPUs online is used for the number of instances. IfNis zero, then the number of configured CPUs in the system is used. SpecifyingNas 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 successfulnice(2)call will attempt to also set the/proc/self/autogroupsetting to the niceness level of the calling process. This is a Linux only option for the CFS scheduler whenCONFIG_SCHED_AUTOGROUPis enabled, seesched(7)for more details on how this affects interactive scheduling behaviour. Linux only. ๐ง-b N,--backoff Nโ waitNmicroseconds between the start of each stress worker process. This allows one to ramp up the stress tests over time. โณ--buddystat Sโ everySseconds 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,vectorandvm. Some stressors fall into just one class. For example thegetstressor is just in theosclass. Other stressors fall into more than one class, for example, thelsearchstressor falls into thecpu,cpu-cache,memoryandsearchclasses 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--sequentialoption.
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 buildstress-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โ everySseconds 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,registersto exercise branching and processor registers. Use the--all,--permuteor--seqoptions to specify how to run the stressors. The features available are as follows: ๐ง\?โ shows the per-stressor features โจatomicโ atomic operationsbackend-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 operationsbranch-missโ CPU branch missesbus-lockโ high split lock or locked access operationschaotic-loadโ generates chaotic system loadcipherโ cipher computationcontext-switchesโ exercises a high context switch ratecoverageโ generates relatively high kernel function test coveragecpu-shiftโ CPU left/right shift/rotate operationscpu-bitโ CPU logical bit-wise operations (and,or,xor,not)cpu-heavy-opsโ execution pipeline saturated with heavy operationscpu-instructionsโ exercises a higher than normal instruction ratecpu-migrationsโ generates migrations of stressors between CPUscpu-opcodeโ exercises unusual, invalid / privileged instruction opcodescpu-vectorโ exercises CPU vector operationscryptoโ cryptography computationd-cacheโ data cache operationsd-cache-l1-readโ data cache level 1 read operationsd-cache-l1-writeโ data cache level 1 write operationsd-cache-ll-readโ data cache lowest level read operationsd-cache-ll-writeโ data cache lowest level write operationsd-cache-missโ data cache miss (read or write)d-cache-prefetchโ data cache prefetch (if available)d-cache-read-missโ data cache read missd-cache-write-missโ data cache write missd-tlb-read-missโ data cache TLB (translation lookaside buffer) read missd-tlb-write-missโ data cache TLB (translation lookaside buffer) write missdirectoryโ file system directory operationsfile-lockโ file lock operationsfrontend-decoderโ exercises the CPU instruction frontend decoderfilemap-page-cacheโ kernel filemap page cache hit/missfpโ floating point operationsfp-complexโ complex floating point operationsfp-decimalโ decimal floating point operationsfp-divisionโ floating point division operationsfp-opsโ a relatively high floating point operation ratefrontend-bound-bandwidthโ the front end fetches and decodes instructions at a slower rate than the back end is capable of executing themhashโ hash computationheapโ exercises memory allocation via the heaphot-packageโ hot processor packagehotplugโ hardware hotplugging (e.g. CPUs, memory)i-cacheโ instruction cache operationsi-tlb-read-missโ instruction cache TLB (translation lookaside buffer) read missintegerโ integer operationsinteger-divisionโ integer point division operationsinteger-opsโ a relatively high integer operation ratehashโ hash computation (yep, it's in the list twice โ keeping it ๐ฏ faithful, not me being chaotic ๐)heapโ exercises memory allocation via the heaphot-packageโ hot processor packageinterruptโ high interrupt rateio-asyncโ asynchronous file I/O operationsio-readโ a relatively high rate of I/O read operationsio-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 completeio-writeโ a relatively high rate of I/O write operationsioport-readโ ioport read operationsioport-writeโ ioport write operationsipcโ inter-process communication primitiveskmallocโ kernel physical contiguous memory allocationload-averageโ high load average (typically at least 4 times more than the number of stressor instances)lock-contentionโ kernel lock contentionmaple-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 exercisingmemory-boundโ memory bandwidth saturation and/or cache missesmemory-cmpโ memory comparison operations (in searching and sorting)memory-copyโ memory copy operationsmemory-loadsโ relatively heavy memory load operationsmemory-stallโ pauses in the execution pipe line due to memory waitsmemory-storesโ relatively heavy memory store operationsmemory-streamโ streaming memory read and/or write operationsmemory-misalignedโ memory misaligned reads/writesmmap-lockโ kernel memory mapping lockoomโ forces out-of-memory failures ๐page-faults-kernelโ kernel space page faultspage-faults-majorโ user space major page faultspage-faults-minorโ user space minor page faultspage-faults-userโ user space page faultspower-coreโ processor core high power consumptionpower-packageโ processor package high power consumptionpower-uncoreโ processor uncore high power consumptionregistersโ CPU registers exercisingspeculation-mispredictโ triggers CPU execution speculation mispredictionstackโ process stack memory operationsstringโ string operationsswapโ page swapping (swapfile) exercisingsyscall-rateโ a high rate of system calls per secondsystem-timeโ around 90% or more execution time in kernel spacetimerโ clocks, alarms and timers exercisingtlbโ translation lookaside buffer exercisingtlb-flushโ translation lookaside buffer flushesuser-timeโ around 99% or more execution time in user spacev4l2โ video for linux (version 2) exercisingvirtโ virtual machine operationsvmallocโ heavy vmalloc kernel memory allocation exercisingwriteback-dirty-folioโ dirty file folio pages written back to storagewriteback-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 usedaclโ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,forkgrabs you themmapandforksystem calls. Drop a\?as the list option and it'll show you which system calls each stressor actually uses ๐. And fr, use--all,--permuteor--seqto 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/sysinterface 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 areidle(the default),besteffort,be,realtime,rt.--ionice-level levelโ sets the ionice level (Linux only). Foridle,0is literally the only possible option. Forbesteffortorrealtime, it goes0(highest priority) to7(lowest priority). Peepionice(1)for the full lore โจ.--iosโ report I/O average read/write rates (Linux only).-I S,--iostat Sโ everySseconds, 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 sequentiallyrun 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 isstress-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), seerlimit(2)RLIMIT_AS. The parameter can be an absolute number of bytes (like1Gfor 1 GB) or a percentage of the current free memory, like20%.--limit-dataโ sets the stressor process's maximum size of the data segment (initialized data, uninitialized data, and heap), seerlimit(2)RLIMIT_DATA. The parameter can be an absolute number of bytes (like128Mfor 128 MB) or a percentage of the current free memory, like5%.--limit-stackโ sets the stressor process's maximum size of the stack, seerlimit(2)RLIMIT_STACK. The parameter can be an absolute number of bytes (like2Mfor 2 MB) or a percentage of the current free memory, like1%.--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-briefoutputs 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 automaticallyfsync'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/debugfault 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 from10up to the maximum limit ofRLIMIT_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 Linuxset_mempolicy(2)call with theMPOL_BINDmode. The NUMA nodes to use are given by a comma separated list of nodes (0toN โ 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 than100%.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 (noCPU 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 version0.02.26stress-ng automatically callsmadvise(2)with random madvise advice options before eachmmap(2)andmunmap(2)call to stress the vm subsystem a little harder. The--no-adviseoption turns this default off.--no-madvise-optsmadvice-list โ specify one or moremadvise(2)advice options to not use. By default, stress-ng enables all the available madvise advice options for randomly selecting one before eachmmap(2)andmunmap(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,unmergeableandwillneed.--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-bytesN โ 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.2Mfor 2 MB) or a percentage of the current free memory, e.g.5%(the default is2.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 thebigheap,mmapandvmstressors. It will severely degrade performance when the memory in the system is less than the allocated buffer sizes. This usesmincore(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,sysinvalandwatchdog.--pauseT โ 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 toperf_event_open(2): โAlways double-check your results! Various generalized events have had wrong valuesโ. Note that with Linux 4.7 one needs to haveCAP_SYS_ADMINcapabilities for this option to work, or adjust/proc/sys/kernel/perf_event_paranoidto below 2 to use this withoutCAP_SYS_ADMIN.--permuteN โ 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 to2โ20permutations. Use this in conjunction with the--withor--classoption to specify the stressors to permute.--progressโ display the run progress when running stressors with the--sequentialoption.-q,--quietโ do not show any output.-rN,--randomN โ start N random stress workers. If N is0, 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.--raplstatS โ every S seconds show RAPL energy measurements. Currently Linux and x86 only, requires root access rights to read RAPL kernel interfaces.--resctrlp1[,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:
pNis the partition definition name whereNis a number, e.g.p1nodespecifies cluster node of CPUs to usecachelevelspecifies the cache level to use (optional, the default is the MPAM default L3 level)hexbitmaskis a hexadecimal bitmask specifying cache portions to usebandwidthis the bandwidth to use, for MPAM this is % utilization1..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 ๐
--schedscheduler โ select the named scheduler (only on Linux). Wanna see the list of available schedulers? just run:stress-ng --sched whichโจ--sched-prioprio โ select the scheduler priority level (only on Linux). If the scheduler doesn't support this then the default priority level of0is chosen. no drama ๐ธ--sched-periodperiod โ select the period parameter for the deadline scheduler (only on Linux). The default value is0(in nanoseconds).--sched-runtimeruntime โ select the runtime parameter for the deadline scheduler (only on Linux). The default value is99999(in nanoseconds).--sched-deadlinedeadline โ select the deadline parameter for the deadline scheduler (only on Linux). The default value is100000(in nanoseconds).--sched-reclaimโ use the CPU bandwidth reclaim feature for the deadline scheduler (only on Linux). slay ๐ฆ--seedN โ 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 ๐--sequentialN โ 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 ๐ฅ--statusN โ report every N seconds the number of running, exiting, reaped and failed stressors, the number of stressors that received theSIGARLMtermination 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 version0.15.08output is written to stdout; previously, due to a historical oversight, output went to stderr. This option lets you revert to the pre-0.15.08behaviour. nostalgia for the old days ๐--stdoutโ all output goes to stdout. This is the new default for version0.15.08. Use the--stderroption for the original behaviour. she moved on, bestie โจ--stressor-timeโ (requires the-vflag) 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:DDwhere 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. Iflocaltime(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-vmessages) to the syslog. so the sysadmin can find it later ๐--tasksetlist โ set CPU affinity based on the list of CPUs provided; stress-ng is bound to just use these CPUs (for systems that providesched_setaffinity(2)). The CPUs to be used are specified by a comma separated list of CPU (0to N โ 1). You can specify a range of CPUs using-, for example:--taskset 0,2-3,6,7-11or the following keywords:evenโ even numbered CPUsoddโ odd numbered CPUsallโ all CPUsrandomโ random selection of CPUspackageNโ CPUs in package N as specified by/sys/devices/system/cpu/cpu*/topology/package_cpus_listclusterNโ CPUs in package N as specified by/sys/devices/system/cpu/cpu*/topology/cluster_cpus_listdieNโ CPUs in package N as specified by/sys/devices/system/cpu/cpu*/topology/die_cpus_listcoreNโ 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-pathpath โ 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 ๐ซถ--thermalstatS โ 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.
-tN,--timeoutT โ 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 suffixs,m,h,dory. Each stressor will be sent aSIGALRMsignal 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. A0timeout will run stress-ng forever with no timeout. The default timeout is 24 hours. yes, twenty-four hours by default, she's committed ๐ญ--timer-slackN โ 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 of0for the timer-slack will set the system default of50000nanoseconds. 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 thefailtag failures that are detected. trust but verify, bestie ๐ง--verifiableโ print the names of stressors that can be verified with the--verifyoption. 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 ๐ธ--vmstatS โ 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 thevmstat(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,--withlist โ specify stressors to run when using the--all,--seqor--permuteoptions. For example, to run 5 instances of thecpu,hash,nopandvmstressors one after another (sequentially) for 1 minute per stressor use:
stress-ng --seq 5 --with cpu,hash,nop,vm --timeout 1m
-x,--excludelist โ 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--classoption,--sequential,--alland--randomoptions. Example, run the CPU class stressors concurrently and exclude thenumaandsearchstressors:
stress-ng --class cpu --all 1 -x numa,bsearch,hsearch,lsearch
-Y,--yamlfilename โ 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
--accessN โ 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 usingaccess(2)andfaccessat(2). Permission vibes check โจ--access-opsN โ tells the access workers to stop after N bogo access sanity checks.
๐ Process accounting stressor
--acctN โ starts N workers that go exercise theacct(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 needsCAP_SYS_PACCTcapabilities, no cap ๐งข--acct-opsN โ stop after N bogo accounting records have been read.
๐ POSIX Access Control List stressor
--aclN โ 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-opsN โ stops acl workers once N bogo acl settings have been set.
๐ Affinity stressor
--affinityN โ starts N workers, and each one runs 16 processes that rapidly flip CPU affinity (on systems that actually providesched_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-delayN โ 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 is0nanosconds.--affinity-opsN โ 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-procsN โ 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-sleepN โ sleeps for N nanoseconds before changing affinity to the next CPU.
๐ Kernel crypto AF_ALG API stressor
--af-algN โ 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/cryptofile) straight to standard output (stdout).--af-alg-opsN โ 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.allis the default, and yes it means literally all the types.
๐ Asynchronous I/O stressor (POSIX AIO)
--aioN โ 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-opsN โ stop POSIX asynchronous I/O workers after N bogo asynchronous I/O requests.--aio-requestsN โ 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)
--aiolN โ starts N workers that issue multiple 4 K random asynchronous I/O writes using the Linux aio system callsio_setup(2),io_submit(2),io_getevents(2)andio_destroy(2). By default each worker process handles 16 concurrent I/O requests.--aiol-opsN โ stop Linux asynchronous I/O workers after N bogo asynchronous I/O requests.--aiol-requestsN โ sets how many Linux asynchronous I/O requests each worker should issue. Default is 16, and 1 to 4096 are allowed.
๐ Alarm stressor
--alarmN โ starts N workers that exercisealarm(2)withMAXINT,0and 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-opsN โ stop after N alarm bogo operations.
๐ AppArmor stressor
--apparmorN โ 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 theCAP_MAC_ADMINcapability. Root girlies only ๐--apparmor-opsโ stops the AppArmor workers after N bogo operations.
๐ Atomic stressor
--atomicN โ 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-opsN โ stops the atomic workers after N bogo atomic operations.
๐ Bad alternative stack stressor
--bad-altstackN โ starts N workers that create broken alternative signal stacks forSIGSEGVandSIGBUShandling, 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
NULLalternative 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
SIGBUSerror.
--bad-altstack-opsN โ stops the bad alternative stack stressors after N SIGSEGV bogo operations.
๐ Bad ioctl stressor
--bad-ioctlN โ starts N workers that perform a whole range of illegal bad readioctl(2)calls (using_IOR) and write ioctls (using_IORwithPROT_NONEmapped pages) across the device drivers. This exercises page size, 64 bit, 32 bit, 16 bit and 8 bit reads, plusNULLaddresses, non-readable pages andPROT_NONEmapped pages. Currently Linux only, and it requires the--pathologicaloption ๐ซ--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 israndom-inc. The available bad-ioctl methods are described as follows:incโ increment ioctl command by 1randomโ use a random ioctl commandrandom-incโ increment ioctl command by a random valuerandom-strideโ increment ioctl command number by 1 and decrement command type by 3
--bad-ioctl-opsN โ stops the bad ioctl stressors after N bogo ioctl operations.
๐ Bessel functions
--besselmathN โ 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-opsN โ stop after N bessel bogo-operation loops.--besselmath-methodmethod โ specifies which Bessel function to exercise. The available bessel stress methods are described as follows:allโ iterate over all the below Bessel functions methodsj0โ double precision Bessel function of the first kind of order 0j1โ double precision Bessel function of the first kind of order 1jnโ 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 0j1fโ float precision Bessel function of the first kind of order 1jnfโ 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 0j1lโ long double precision Bessel function of the first kind of order 1jnlโ 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 0y1โ double precision Bessel function of the second kind of order 1ynโ 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 0y1fโ float precision Bessel function of the second kind of order 1ynfโ 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 0y1lโ long double precision Bessel function of the second kind of order 1ynlโ 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 upNworkers 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, asNbytes 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 suffixb,k,morg. Slay, flexible units ๐--bigheap-growth Nโ how much memory to grow the heap by per iteration. Size can be from4 Kto64 MB. Default is64 K.--bigheap-mlockโ attempt tomlock(2)future allocated pages into memory, which causes more memory pressure (iconic chaos honestly). Ifmlock(MCL_FUTURE)is implemented then this will stop newly allocated pages from being swapped out. ๐ซถ--bigheap-ops Nโ stop the big heap workers afterNbogo allocation operations are completed.
๐ Binderfs stressor ๐
--binderfs Nโ startNworkers that mount, exercise and unmount binderfs. The binder control device gets exercised with256sequentialBINDER_CTL_ADDioctl(2)calls per loop. busy busy busy โจ--binderfs-ops Nโ stop afterNbinderfs cycles.
๐ Bind mount stressor ๐
--bind-mount Nโ startNworkers that repeatedly bind mount/binto 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 afterNbind mount bogo operations.
๐ฆ Bitonic sort stressor ๐ฆ
--bitonicsort Nโ startNworkers that sort32bit integers using bitonic sort. so satisfying to watch, lowkey โจ--bitonicsort-ops Nโ stop bitonic sort stress workers afterNbogo bitonic sorts.--bitonicsort-size Nโ how many32bit integers to sort, default is262144(256 ร 1024).
๐ Bit manipulation operations ๐
--bitops Nโ startNworkers that perform various calculations using32bit 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 afterNbitop 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 a32bit signed integer. Computed two different ways, one with masking and addition, one with masking and subtraction.bswapโ swap bytes in a32bit unsigned integer. Computed3ways, 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 a32bit unsigned integer. Computed six different ways, two with bit counting, one with64bit 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 a32bit 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 a32bit 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 two32bit unsigned integers with comparison results ofโ1,0,1for less than, equal or greater than. Computed3ways, one using simple comparisons, two using comparisons and subtraction.log2โ calculate log base 2 of a32bit 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 two32bit 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 two32bit 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 a32bit 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 a32bit unsigned integer is a power of 2. Computed using bit counting and with a mask ofvalue โ 1.rnddnpwr2โ find the nearest power of 2 of a32bit 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 a32bit 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 a32bit unsigned integer. Computed six ways, one using bit shifting loop, one using bit shifting and mask loop, one using parallelised masking and shifting, one using64bit multiplication, one using32bit multiplication, one using the builtin bitreverse32 function. ๐ซsignโ calculate the sign of a32bit signed integer. Computed two ways, one using a branchless less than zero operator, one using sign bit shifting and negation.swapโ swap two32bit signed integers without a temporary variable. Computed two ways, one using subtraction and addition, one using xor'ing.zerobyteโ determine of a32bit 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 thebpf(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 of2048bpf 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 is2, maximum is1048576. no cap on the range knowledge ๐--bpf-ops Nโ stop after Nbpf(2)system calls. periodt.
๐ธ Branch stressor ๐ฆ
--branch Nโ start N workers that randomly branch to1024randomly 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 ร1024branches. math girlie behavior ๐
๐ Brk stressor ๐
--brk Nโ start N workers that grow the data segment by one page at a time using multiplebrk(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 suffixb,k,morgโจ--brk-mlockโ attempt tomlock(2)future brk pages into memory, which causes more memory pressure. ifmlock(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 usingbsearch(3). by default there are65536elements 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 from1 Kto64 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 is16384.
๐ 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-zyxoption 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 usingcldemote,clflushopt,fence,flush,sfenceandprefetch. 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--cacheis 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-allwith 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 thesfenceinstruction (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 suffixb,k,morg๐--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 is4times 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;permuteperforms 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 runs1or 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 tocapget(2)andcapset(2), (Linux only).--cap-ops Nโ stop after Ncapset/capgetbogo 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 theEXT2_IOC_SETFLAGSioctl(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 usingchdir(2).--chdir-dirs Nโ exercise chdir on N directories. The default is8192directories, 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 viachmod(2)andfchmod(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 exercisechown(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 bogochown(2)operations.
๐ฅ Chroot stressor ๐ฅ
--chroot Nโ start N workers that exercisechroot(2)on various valid and invalid chroot paths. Only available on Linux systems and requires theCAP_SYS_ADMINcapability.--chroot-ops Nโ stop the chroot workers after N bogochroot(2)operations.
๐ Complex hyperbolic functions stressor ๐
--chyperbolic Nโ start N workers that exercise complexsinh,cosh, andtanhlibm 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 functionsccoshโ 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 exerciseclock_getres(2),clock_gettime(2)andclock_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 theclone(2)andclone3(2)system calls). This will rapidly try to create a default of8192clones 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 of8.--close-ops Nโ stop close workers after N bogo close operations.
๐ Swapcontext stressor ๐
--context Nโ start N workers that run three threads that useswapcontext(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 1000swapcontextcalls.
๐ซถ Copy file stressor ๐ซถ
--copy-file Nโ start N stressors that copy a file using the Linuxcopy_file_range(2)system call.128 KBchunks of data are copied from random locations from one file to random locations to a destination file. By default, the files are256 MBin size. Data is sync'd to the filesystem after eachcopy_file_range(2)call.--copy-file-bytes Nโ copy file size, the default is256 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 suffixb,k,morg.--copy-file-io-bytes Nโcopy_file_range(2)copying I/O size, the default is128 KB, range4 Kto1 MB.--copy-file-ops Nโ stop after Ncopy_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-methodoption.-l P,--cpu-load Pโ load CPU with P percent loading for the CPU stress workers.0is effectively a sleep (no load) and100is 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-loadis 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 onS:- A negative value for
S= the number of iterations to run before idling the CPU (so-30invokes 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 (so100keeps the CPU busy for 0.1 seconds). โฑ๏ธ
- A negative value for
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 methodsackermannโ 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 of1/(n โ 3)to a precision of1.0x10โ14bitopsโ various bit operations from bithack, namely: reverse bits, parity check, bit count, round to nearest power of 2callfuncโ recursively call 8 argument C function to a depth of 1024 calls and unwindcfloatโ 1000 iterations of a mix of floating point complex operationscdoubleโ 1000 iterations of a mix of double floating point complex operationsclongdoubleโ 1000 iterations of a mix of long double floating point complex operationscollatzโ compute the 1348 steps in the collatz sequence starting from number989345275647. Wheref(n) = n / 2(for even n) andf(n) = 3n + 1(for odd n).correlateโ perform a8192 ร 512correlation of random doublescrc16โ 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 a1024 ร 768random image from 8 bits down to 1 bit of depthdiv8โ 50000 8 bit unsigned integer divisionsdiv16โ 50000 16 bit unsigned integer divisionsdiv32โ 50000 32 bit unsigned integer divisionsdiv64โ 50000 64 bit unsigned integer divisionsdiv128โ 50000 128 bit unsigned integer divisionsdoubleโ 1000 iterations of a mix of double precision floating point operationseulerโ compute e usingn = (1 + (1 รท n)) โ nexplogโ iterate onn = exp(log(n) รท 1.00002)factorialโ find factorials from 1..150 using Stirling's and Ramanujan's approximationsfibonacciโ compute Fibonacci sequence of0, 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 checksumfloatโ 1000 iterations of a mix of floating point operationsfloat16โ 1000 iterations of a mix of 16 bit floating point operationsfloat32โ 1000 iterations of a mix of 32 bit floating point operationsfloat64โ 1000 iterations of a mix of 64 bit floating point operationsfloat80โ 1000 iterations of a mix of 80 bit floating point operationsfloat128โ 1000 iterations of a mix of 128 bit floating point operationsfloatconversionโ 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 logarithmln(n), forn = 80000.gcdโ compute GCD of integersgrayโ calculate binary to gray code and gray code back to binary for integers from 0 to 65535hammingโ compute HammingH(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 bitsd1..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 theackermannCPU stress method.hyperbolicโ computesinh(ฮธ) ร cosh(ฮธ) + sinh(2ฮธ) + cosh(3ฮธ)for float, double and long double hyperbolic sine and cosine functions whereฮธ = 0to2ฯin 1500 steps ๐ฆidctโ8 ร 8IDCT (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 betweenint16,int32andint64variables.ipv4checksumโ compute 1024 rounds of the 16 bit ones' complement IPv4 checksum.jmpโ Simple unoptimised compare>,<,==andjmpbranching.lfsr32โ 16384 iterations of a 32 bit Galois linear feedback shift register using the polynomialxโ32 + xโ31 + xโ29 + x + 1. This generates a ring of2โ32 โ 1unique values (all 32 bit values except for 0).ln2โ computeln(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)wherer > โผ 3.56994567longdoubleโ 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 two128 ร 128matrices 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โ computesqrt()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 ofrand(), 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 ofdrand48(3)andlrand48(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โ computesqrt(rand()), where rand is the MWC pseudo random number generator.trigโ computesin(ฮธ) ร 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 versionV0.14.02the 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 usingSCHED_OTHER,SCHED_BATCH,SCHED_IDLE,SCHED_EXT,SCHED_DEADLINE,SCHED_RRandSCHED_FIFOpolicies. 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_crcfunctions 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 datacrc16_data8โ 16 bit CRC with 128 ร 8 bit datacrc16_data16โ 16 bit CRC with 64 ร 16 bit datacrc32_data8โ 32 bit CRC with 128 ร 8 bit datacrc32_data16โ 32 bit CRC with 64 ร 16 bit datacrc32_data32โ 32 bit CRC with 32 ร 32 bit datacrc64_data8โ 64 bit CRC with 128 ร 8 bit datacrc64_data16โ 64 bit CRC with 64 ร 16 bit datacrc64_data32โ 64 bit CRC with 32 ร 32 bit datacrc64_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 usingcrypt(3). The password is encrypted usingbcrypt,bsdicrypt,descrypt,gost-yescrypt,MD5,NT,scrypt,SHA-1,SHA-256,SHA-512,SunMD5andyescryptencryption 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,SunMD5andyescrypt. Theallmethod 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 functionsccosโ 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 withCAP_SYS_NICEcapability 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 overNnanoseconds. 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 ofNnanoseconds โจ. 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 isclock_ns. The available methods are, bestie:clock_nsโ sleep for the specified time using theclock_nanosleep(2)high resolution nanosleep and theCLOCK_REALTIMEreal time clock.itimerโ wakeup a paused process with aCLOCK_REALTIMEitimer signal.pollโ delay for the specified time using a poll delay loop that checks for time changes usingclock_gettime(2)on theCLOCK_REALTIMEclock.posix_nsโ sleep for the specified time using the POSIXnanosleep(2)high resolution nanosleep.pselectโ sleep for the specified time usingpselect(2)with null file descriptors.usleepโ sleep to the nearest microsecond usingusleep(2).
--cyclic-ops Nโ stop afterNsleeps ๐ด.--cyclic-policy [ batch | deadline | ext | fifo | idle | other | rr ]โ sets the scheduling policy you want ๐:batch,deadline,ext,fifo(first-in, first-out),idle,otherorrr(round-robin).--cyclic-prio Pโ sets the scheduling priorityP. Range goes from1(lowest) to100(highest) โ know your power level ๐.--cyclic-samples Nโ measureNsamples ๐งช. Range from1to100000000samples.--cyclic-sleep Nโ sleep forNnanoseconds per test cycle usingclock_nanosleep(2)with theCLOCK_REALTIMEtimer. Range from1to1000000000nanoseconds โฑ๏ธ.
๐ง Daemon stressor ๐ง
--daemon Nโ startNworkers 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 byinit. It puts pressure oninitto 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), range4Kto64MB.--daemon-ops Nโ stop daemon workers afterNdaemons have been created.--daemon-waitโ wait for daemon child processes rather than letinithandle 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โ startNworkers 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 isipv4. Right nowipv4andipv6are the supported ones.--dccp-if NAMEโ use network interfaceNAME๐ฆ. If the interfaceNAMEdoesn't exist, isn't up, or doesn't support the domain, then the loopback (lo) interface is used as the default.--dccp-msgs Nโ sendNmessages per connect, send/receive, disconnect iteration. Default is10000messages. Fair warning: ifNis too small, the rate gets throttled back by the overhead of dccp socket connect and disconnects ๐.--dccp-port Pโ start DCCP at portP. ForNdccp worker processes, portsPtoP + (Nโ1)are used (wrapped to keep in range of1024to65535). Default port is port49152๐.--dccp-ops Nโ stop dccp stress workers afterNbogo operations.--dccp-opts [ send | sendmsg | sendmmsg ]โ by default, messages are sent usingsend(2). This lets you pick the sending method withsend(2),sendmsg(2)orsendmmsg(2). Note thatsendmmsgis only available for Linux systems that support this system call ๐ง.
๐ Mutex using Dekker algorithm stressor ๐
--dekker Nโ startNworkers 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_synchronizeif they're not available. The stressors contain simple mutex and memory coherency sanity checks.--dekker-ops Nโ stop dekker workers afterNmutex operations.
๐ Dentry stressor ๐
-D N,--dentry Nโ startNworkers 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 afterNbogo dentry operations.--dentry-order [ forward | reverse | stride | random ]โ sets the unlink order of dentries, and it can be one offorward,reverse,strideorrandom๐. By default, dentries are unlinked inrandomorder.forwardunlinks them from first to last,reverseunlinks them from last to first,strideunlinks them by stepping around order in a quasi-random pattern, andrandomrandomly selects one offorward,reverseorstrideorders.--dentries Nโ createNdentries per dentry thrashing loop, default is2048.
๐ณ๏ธ Negative dentry cache stressor ๐ณ๏ธ
--dentrycache Nโ startNworkers that access non-existent files to fill the dentry cache with negative dentries ๐ญ. A maximum of2^64unique dentry names can be created per stressor instance given enough time. Use the--buddystator--vmstatoption 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 afterNnon-existent files are accessed.
๐ฅ๏ธ /dev stressor ๐ฅ๏ธ
--dev Nโ startNworkers that exercise the/devdevices ๐ . Each worker runs5concurrent threads that performopen(2),fstat(2),lseek(2),poll(2),fcntl(2),mmap(2),munmap(2),fsync(2)andclose(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 afterNbogo device exercising operations.
๐ง /dev/shm stressor ๐ง
--dev-shm Nโ startNworkers thatfallocatelarge files in/dev/shmand thenmmapthese into memory and touch all the pages ๐ซถ. This exercises pages being moved to/from the buffer cache. Linux only ๐ง.--dev-shm-ops Nโ stop afterNbogo allocation andmmap/dev/shmoperations.
๐ข Decimal floating point operations stressor ๐ข
--dfp Nโ startNworkers that exercise addition, multiplication and division operations on a range of decimal floating point types โจ. For each type,8floating point values are operated upon65536times 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 afterNdecimal floating point bogo ops. that's it, that's the whole vibe ๐
๐๏ธ Directories stressor
--dir Nโ startNworkers that create, rename and remove directories usingmkdir(2),rename(2)andrmdir(2). directory chaos on loop, no cap ๐ฅ--dir-dirs Nโ exercise dir onNdirectories. the default is8192directories, and this lil option lets you go anywhere from64to65536instead ๐ฆ--dir-ops Nโ stop the directory thrash workers afterNbogo directory operations โจ
๐ฒ Deep directories stressor
--dirdeep Nโ startNworkers that create a depth-first tree of directories to a maximum depth as limited byPATH_MAXorENAMETOOLONG(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 of10sub-trees using the--dirdeep-diroption. 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 is0. you can specify the size as%of free space on the file system or in units of Bytes, KBytes, MBytes and GBytes using the suffixb,k,morg. this one's used in conjunction with the--dirdeep-filesoption ๐--dirdeep-dirs Nโ createNdirectories at each tree level. the default is just1but it can be increased to a maximum of36per level ๐--dirdeep-files Nโ createNfiles at each tree level. the default is0, with the file size specified by the--dirdeep-bytesoption ๐--dirdeep-inodes Nโ consume up toNinodes per dirdeep stressor while creating directories and links. the valueNcan 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 afterNbogo directory operations โญ
๐ Maximum files creation in a directory stressor
--dirmany Nโ startNstressors 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 is0. one can specify the size as%of free space on the file system or in units of Bytes, KBytes, MBytes and GBytes using the suffixb,k,morg๐--dirmany-ops Nโ stop dirmany stressors afterNempty files have been created ๐ซถ
๐ Dnotify stressor
--dnotify Nโ startNworkers 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 afterNdnotify bogo operations.
๐ซง Dup stressor
--dup Nโ startNworkers that performdup(2)and thenclose(2)operations on/dev/zero. the maximum opens at one time is system defined, so the test will run up to this maximum, or65536open file descriptors, whichever comes first. fd hoarding era ๐--dup-ops Nโ stop the dup stress workers afterNbogo open operations.
๐ Dynamic libraries loading stressor
--dynlib Nโ startNworkers that dynamically load and unload various shared libraries. this exercises memory mapping and dynamic code loading and symbol lookups. seedlopen(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 afterNbogo load/unload cycles.
๐ง Easy CPU opcode stressor
--easy-opcode Nโ startNworkers that exercise64continuous pages of randomly selected simple CPU opcodes. for example, for x86 processors this just exercises single byte opcodes such asnopand op-codes that set/clear CPU flags to put pressure on the front-end decoder and instruction cache. for RISC processors opcodes such asnopand 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 afterNexecutions of64continuous pages of opcodes.
๐งฎ Eigen C++ matrix library stressor
--eigen Nโ startNworkers that exercise the Eigen C++ matrix library for 2D matrix addition, multiplication, determinant, inverse and transpose operations onlong double,doubleandfloatmatrices. this currently is only available forgcc/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 operationsadd-longdoubleโ addition of two matrices of long double floating point valuesadd-doubleโ addition of two matrices of double floating point valuesadd-floatโ addition of two matrices of floating point valuesdeterminant-longdoubleโ determinant of matrix of long double floating point valuesdeterminant-doubleโ determinant of matrix of double floating point valuesdeterminant-floatโ determinant of matrix of floating point valuesinverse-longdoubleโ inverse of matrix of long double floating point valuesinverse-doubleโ inverse of matrix of double floating point valuesinverse-floatโ inverse of matrix of floating point valuesmultiply-longdoubleโ multiplication of two matrices of long double floating point valuesmultiply-doubleโ multiplication of two matrices of double floating point valuesmultiply-floatโ multiplication of two matrices of floating point valuestranspose-longdoubleโ transpose of matrix of long double floating point valuestranspose-doubleโ transpose of matrix of double floating point valuestranspose-floatโ transpose of matrix of floating point values
--eigen-ops Nโ stop afterNEigen matrix computations โจ--eigen-size Nโ specify the 2D matrix sizeN ร N. the default is a32 ร 32matrix ๐
โ๏ธ EFI variables stressor
--efivar Nโ startNworkers that exercise the Linux/sys/firmware/efi/efivarsand/sys/firmware/efi/varsinterfaces by reading the EFI variables. this is a Linux only stress test for platforms that support the EFI vars interface and may require theCAP_SYS_ADMINcapability. fancy permissions required, bestie, act accordingly ๐--efivar-ops Nโ stop the efivar stressors afterNEFI variable read operations.
๐ซ Non-functional system call (ENOSYS) stressor
--enosys Nโ startNworkers 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 returnENOSYS) so that it can focus on purely finding and exercising non-functional system calls. this stressor exercises system calls from0to__NR_syscalls + 1024, random system calls within constrained in the ranges of0to2โ8,2โ16,2โ24,2โ32,2โ40,2โ48,2โ56and2โ64bits, 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 afterNbogo enosys system call attempts.
๐ฑ Environment variables stressor
--env Nโ startNworkers that create numerous large environment variables to try to trigger out of memory conditions usingsetenv(3). ifENOMEMoccurs 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 afterNbogosetenv/unsetenvattempts.
๐ Epoll stressor
--epoll Nโ startNworkers that perform various related socket stress activity usingepoll_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 isunix(aka local). Right nowipv4,ipv6andunixare the supported ones. ๐--epoll-ops Nโ makes the epoll workers stop afterNbogo operations. That's the finish line, periodt. ๐--epoll-port Pโ start at socket portP. ForNepoll worker processes, portsPto(P ร 4) โ 1are used for theipv4andipv6domains, and portsPtoP โ 1are used for theunixdomain. Ports get wrapped to keep in range of1024to65535. The default port is port49408. โจ--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โ startsNworkers that exercise many file descriptors usingepoll_create1(2)andepoll_ctl(2). Each new epoll file descriptor has up to16pipe 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 explicitepoll_ctl(2)EPOLL_CTL_DELon each file descriptor instead. ๐๏ธ--epollmany-fdsโ specify the number of file descriptors to be created viaepoll_create1(2). Default is512, with a range of1to1000000. ๐--epollmany-ops Nโ stop afterNepoll_create1(2)operations.
๐ก Ethernet packet sniffer
--eth-sniff Nโ startsNstressors that sniff ethernet packets. The--metricsoption will show the data count in kilobytes of commonly usedIPv4andIPv6protocols. Linux only and requires theCAP_NET_RAWcapability โ so like, bring the right permissions or it's not happening. ๐ซถ--eth-sniff-ops Nโ stop afterNbogo ethernet packet sniffs.
๐ Event file descriptor (eventfd) stressor
--eventfd Nโ startsNparent and child worker processes that read and write8byte event messages between them via the eventfd mechanism (Linux only). ๐--eventfd-nonblockโ enablesEFD_NONBLOCKto allow non-blocking on the event file descriptor. This will cause reads and writes to return withEAGAINrather than blocking, and hence causes a high rate of polling I/O. Busy little bee energy. ๐--eventfd-ops Nโ stop eventfd workers afterNbogo operations.
๐ง Exec processes stressor
--exec Nโ startsNworkers continually forking children thatexecstress-ngand then exit almost immediately. If a system has pthread support, then1in4of 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 usingclone(2),fork(2), BSDrfork(2),posix_spawn(3)orvfork(2). Heads up bestie: note thatvforkwill only exec programs usingexecvedue to the constraints on the shared stack between the parent and the child process. โ ๏ธ--exec-max Pโ createsPchild processes that execstress-ngand then waits for them to exit per iteration. The default is4096; 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-maxand--exec. Zombie apocalypse fr fr ๐--exec-method [ all | execve | execveat | fexecve ]โ selects the exec system call to use.allwill perform a random choice betweenexecve(2),execveat(2)andfexecve(3);execvewill useexecve(2),execveatwill useexecveat(2)(if available) andfexecvewill usefexecve(3)(if available). โจ--exec-no-pthreadโ do not usepthread_create(3). Simple as that. ๐ โโ๏ธ--exec-ops Nโ stop exec stress workers afterNbogo operations.
๐ Exiting pthread groups stressor
--exit-group Nโ startsNworkers that create16pthreads and terminate the pthreads and the controlling child process usingexit_group(2). (Linux only stressor.) Dramatic exit, honestly iconic. ๐ช--exit-group-ops Nโ stop afterNiterations of pthread creation and deletion loops.
๐ Exponential functions
--expmath Nโ startsNworkers that exercise various exponential functions with input values0to1in steps of0.001; the results are sanity checked to ensure no variation occurs after each round of10000computations. Math girlies rise ๐งฎโจ--expmath-ops Nโ stop afterNexponential 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 methodscexpโ double complex natural exponentialcexpfโ float complex natural exponentialcexplโ long double complex natural exponentialexpโ double natural exponentialexpfโ float natural exponentialexplโ long double natural exponentialexp10โ double base-10 exponentialexp10fโ float base-10 exponentialexp10lโ long double base-10 exponentialexp2โ double base-2 exponentialexp2fโ float base-2 exponentialexp2lโ long double base-2 exponential
๐ข Factorization of large integers stressor
--factor Nโ startsNworkers that factorize large integers using the GNU Multiple Precision Arithmetic Library. Randomized values to be factorized are computed so that anNdigit value is comprised of about0.4 ร Nrandom factors, forN > 100. The default number of digits in the value to be factorized is10. Big number brain ๐ง โจ--factor-digits Nโ selects the number of digits in the values to be factorized. Range8to100000000digits, default is10.--factor-ops Nโ stop afterNfactorizations.
๐๏ธ File space allocation (fallocate) stressor
-F N,--fallocate Nโ startsNworkers continually fallocating (preallocating file space) and ftruncating (file truncating) temporary files. If the file is larger than the free space, fallocate will produce anENOSPCerror which is ignored by this stressor. ๐--fallocate-bytes Nโ allocated file size, the default is1 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 suffixb,k,morg. ๐พ--fallocate-ops Nโ stop fallocate stress workers afterNbogo fallocate operations.
๐ Filesystem notification (fanotify) stressor
--fanotify Nโ startsNworkers 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 theCAP_SYS_ADMINcapability โ no cap, no vibes. ๐ซ--fanotify-ops Nโ stop fanotify stress workers afterNbogo fanotify events.
๐ณ CPU branching instruction cache stressor
--far-branch Nโ startsNworkers that exercise calls to tens of thousands of functions that are relatively far from the caller. All functions are1op 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 afterNfar 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 usesmadvise(2)MADV_PAGEOUTandMADV_SOFT_OFFLINEto 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 have4096ร1byte return instructions per4 Kpage, whereas SPARC64 will have only512ร8byte return instructions per4 Kpage. ๐ฅ๏ธ
๐ฉน Page fault stressor
--fault Nโ startsNworkers that generate minor and major page faults.--fault-ops Nโ stop the page fault workers afterNbogo page fault operations.
๐ Fcntl stressor
--fcntl Nโ startsNworkers that performfcntl(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_HINTandF_SET_RW_HINT. That's the whole guest list, bestie ๐--fcntl-ops Nโ stop the fcntl workers afterNbogo 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 usingdup(2)on a file (/dev/zeroby default) and then copies these using multiple fork'd child processes and closes them with the fastclone_range(2)orclose(2)or by directly ending the processes using_exit(2). For every bogo-op, the stressor attempts todup(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:nullfor/dev/null,randomfor/dev/random,stdinfor standard input,stdoutfor standard output,zerofor/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/devand/procfiles can be exercised using the appropriate fd-race options. Race condition speedrun any% ๐ญ--fd-race-devโ exercise/devfiles for race conditions. ๐--fd-race-race-ops Nโ stop after N file descriptors have been exercised. โญ--fd-race-procโ exercise/procfiles 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 absearchexcept 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 overbsearch. 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 theFS_IOC_FIEMAPioctl(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 suffixb,k,morg. 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 specificioctl(2)calls. This will attempt to use theFIONBIO,FIOQSIZE,FIGETBSZ,FIOCLEX,FIONCLEX,FIONBIO,FIOASYNC,FIOQSIZE,FIFREEZE,FITHAW,FICLONE,FICLONERANGE,FIONREAD,FIONWRITEandFS_IOC_RESVSPioctls 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 usesfallocate(2)FALLOC_FL_PUNCH_HOLEandFALLOC_FL_ZERO_RANGEas 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 isfsync'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 suffixb,k,morg. ๐--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 optionopt. 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 theext2,ext3,ext4file systems, namely any 8 bit character apart fromNULand/.utf8โ use strict utf8 characters in filename.urf8-likeโ use utf8 like characters with illegal utf8 encodings when generating random filenames. And yes,urf8-likeis 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 usingcmpxchg(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-taskset1list โ the list of CPUs to affine the flip threads to ๐ . Wanna know the syntax for list? Go peek at the--tasksetoption description, it's all there bestie.--flipflop-taskset2list โ same deal but for the flop threads โ CPUs to affine them to ๐ฆ. Again, syntax lives in the--tasksetdescription.--flipflop-opsN โ stop after N bogo-ops. Warning: in this context a bogo-op is literally100000flip-flop operations, so likeโฆ pace yourself ๐ญ.
๐ง BSD File locking (flock) stressor
--flockN โ start N workers that lock on a single file ๐.--flock-opsN โ stop the flock stress workers after N bogo flock operations.
๐ธ Cache flushing stressor
--flushcacheN โ 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-bytesN โ set the size of the data region to be data-flushed. Range is1Kto4GB, 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 suffixb,k,morg๐.--flushcache-i-bytesN โ set the size of the instruction region to be instruction-flushed. Range1Kto4GB, default is the level 1 instruction cache size. Same deal: % of total available memory, or Bytes/KBytes/MBytes/GBytes via the suffixb,k,morg๐ซถ.--flushcache-opsN โ stop after N cache flush iterations.
๐ฅ Fused Multiply/Add floating point operations (fma) stressor
--fmaN โ start N workers that exercise single and double precision floating point multiplication and add operations on arrays of512floating 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__builtinlibc functions, or the fma libc functions. Generally these are slower than directly multiply/add fused code generated by the compiler, ngl.--fma-opsN โ stop after N bogo-loops of the 3 above operations on512single and double precision floating point numbers.
๐ Process forking stressor
-fN,--forkN โ start N workers continually forking children that immediately exit ๐ญ.--fork-maxP โ create P child processes and then wait for them to exit per iteration. Default is just1; 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-maxand--fork.--fork-opsN โ 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 usingmadvise(2)on all pages of the forked process. Where possible this tries to set every page in the new process usingmadvise(2)with theMADV_MERGEABLE,MADV_WILLNEED,MADV_HUGEPAGEandMADV_RANDOMflags ๐ฅ. Linux only.
๐ Heavy process forking stressor
--forkheavyN โ 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 to4096child processes, created and reaped in a first-in first-out manner.--forkheavy-allocsN โ 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 is16384.--forkheavy-mlockโ attempt tomlock(2)future allocated pages into memory, causing more memory pressure ๐ . Ifmlock(MCL_FUTURE)is implemented then this stops new brk pages from being swapped out.--forkheavy-opsN โ stop after N fork calls.--forkheavy-procsN โ attempt to fork N processes per stressor. The default is4096processes.
โญ Floating point operations stressor
--fpN โ start N workers that exercise addition, multiplication and division operations on a range of floating point types ๐. For each type,8floating point values are operated upon65536times in a loop per bogo op.--fp-methodmethod โ 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 additionibm128addโ IBM 128 bit floating point addition (powerpc)float80addโ 80 bit floating point additionfloat64addโ 64 bit floating point additionfloat32addโ 32 bit binary32 floating point additionfloataddโ floating point additionbf16addโ bf16 floating point additiondoubleaddโ double precision floating point additionldoubleaddโ long double precision floating point additionfloat128subโ 128 bit floating point subtractionibm128subโ IBM 128 bit floating point subtraction (powerpc)float80subโ 80 bit floating point subtractionfloat64subโ 64 bit floating point subtractionfloat32subโ 32 bit binary32 floating point subtractionfloatsubโ floating point subtractionbf16subโ bf16 floating point subtractiondoublesubโ double precision floating point subtractionldoublesubโ long double precision floating point subtractionfloat128mulโ 128 bit floating point multiplicationibm128mulโ IBM 128 bit floating point multiplication (powerpc)float80mulโ 80 bit floating point multiplicationfloat64mulโ 64 bit floating point multiplicationfloat32mulโ 32 bit binary32 floating point multiplicationfloatmulโ floating point multiplicationbf16mulโ bf16 floating point multiplicationdoublemulโ double precision floating point multiplicationldoublemulโ long double precision floating point multiplicationfloat128divโ 128 bit floating point divisionibm128divโ IBM 128 bit floating point division (powerpc)float80divโ 80 bit floating point divisionfloat64divโ 64 bit floating point divisionfloat32divโ 32 bit binary32 floating point divisionfloatdivโ floating point divisionbf16divโ bf16 floating point divisiondoubledivโ double precision floating point divisionldoubledivโ long double precision floating point division
Heads up babes: some of these floating point methods may not be available on some systems ๐.
--fp-opsN โ stop after N floating point bogo ops. Note that bogo-ops are counted for just standardfloat,doubleandlong doublefloating point types ๐.
๐ Floating point exception stressor
--fp-errorN โ start N workers that generate floating point exceptions. Computations are performed to force and check for theFE_DIVBYZERO,FE_INEXACT,FE_INVALID,FE_OVERFLOWandFE_UNDERFLOWexceptions ๐ฅ.EDOMandERANGEerrors are also checked.--fp-error-opsN โ stop after N bogo floating point exceptions.
๐ Miscellaneous floating point math macro operations
--fp-miscN โ start N workers that exercise the following libm floating point macros:fpclassify(3),isgreater(3),isgreaterequal(3),isless(3),islessequal(3),islessgreater(3),isunordered(3),isfinite(3),isnormal(3),isnan(3),isinf(3)andsignbit(3)โจ.Float,doubleandlong doublefloating point values are operated upon using normal, infinite and non-a-number (nan) values.--fp-misc-opsN โ stop after N bogo floating point math macro operations.
๐ฆ Subnormal floating point operations stressor
--fp-subnormalN โ 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 upon65536times in a loop per bogo op. Subnormal floating point values are values where the mantissa does not have a leading binary digit1, 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-methodmethod โ 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 additiondoubleaddโ double precision floating point additionldoubleaddโ long double precision floating point additionfloatsubโ floating point subtractiondoublesubโ double precision floating point subtractionldoublesubโ long double precision floating point subtractionfloatmulโ floating point multiplicationdoublemulโ double precision floating point multiplicationldoublemulโ long double precision floating point multiplicationfloatdivโ floating point divisiondoubledivโ double precision floating point divisionldoubledivโ 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 usesfallocate(2)FALLOC_FL_KEEP_SIZE,FALLOC_FL_PUNCH_HOLE,FALLOC_FL_ZERO_RANGE,FALLOC_FL_COLLAPSE_RANGEandFALLOC_FL_INSERT_RANGEto 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 suffixb,k,morg. 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 a1024x1024point Mandelbrot set is computed with a maximum of256iterations 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 (viasetrlimit(2)RLIMIT_FSIZE) with file sizes that are fixed, random and powers of 2. The files are truncated and allocated to triggerSIGXFSZsignals. 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 errorENOSPC), 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-methodoption. 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 ofbool,uint8,uint16,uint32,uint64,uint128,float,double,longdouble,cfloat(complex float),cdouble(complex double),clongdouble(complex long double),float16,float32,float64,float80,float128,decimal32,decimal64anddecimal128. 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 ofuint8uint16uint32uint64uint128floatdoublelongdoublefloat80float128decimal32decimal64decimal128uint8x32uint8x128uint64x128cfloatcdoubleclongdouble. 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 exercisetgammaandlgammalibm 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 functionslgammaโ 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 Nโ start N workers that call system calls that fetch data from the kernel, currently these are:getpid(2),getppid(2),getcwd(3),getgid(2),getegid(2),getuid(2),getgroups(2),getpgrp(2),getpgid(2),getpriority(2),getresgid(2),getresuid(2),getrlimit(2),prlimit(2),getrusage(2),getsid(2),gettid(2),getcpu(2),gettimeofday(2),uname(2),adjtimex(2),sysfs(2). Some of these system calls are OS specific. a whole roster of getters, and yes they all showed up ๐ค--get-ops Nโ stop get workers after N bogo get operations.--get-slow-syncโ attempt to synchronize system calls across the N get workers to try to force forms of locking contention in the kernel on the more complex cases. Each system call is exercised concurrently with the N workers for 0.1 seconds at a time, so it takes 3-4 seconds to work through all the system calls. slow sync = chaos sync, lowkey ๐
๐ Get directory entries stressor (Linux) ๐
--getdent Nโ start N workers that recursively read directories/proc,/dev/,/tmp,/sysand/runusinggetdents(2)andgetdents64(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 get8192random bytes from the/dev/urandompool using thegetrandom(2)system call (Linux) orgetentropy(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 perform2048forward branches (to next instruction) or backward branches (to previous instruction) for each bogo operation loop. By default, every2048branches 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 every2048branches. pick a lane bestie ๐ซถ--goto-ops Nโ stop goto workers after N bogo loops of2048branch 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 is4096ร4096.--gpu-xsize Xโ framebuffer size of X pixels. Default is256pixels.--gpu-ysize Yโ framebuffer size of Y pixels. Default is256pixels.--gpu-upload Nโ upload the texture N times per frame, default value is1.
๐ซถ Handle stressor ๐
--handle Nโ starts N workers that exercise thename_to_handle_at(2)andopen_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 from1to128bytes 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 to1.0means 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 methodsadler32โ Mark Adler checksum, a modification of the Fletcher checksumcoffinโ xor and 5 bit rotate left hashcoffin32โ xor and 5 bit rotate left hash with 32 bit fetch optimizationcrc32cโ compute CRC32C (Castagnoli CRC32) integer hashdjb2aโ Dan Bernstein hash using the xor variantfnv1aโ FNV-1a Fowler-Noll-Vo hash using the xor then multiply variantjenkinโ Jenkin's integer hashkandrโ Kernighan and Richie's multiply by 31 and add hash from "The C Programming Language", 2nd Editionknuthโ Donald E. Knuth's hash from "The Art Of Computer Programming", Volume 3, chapter 6.4loseloseโ Kernighan and Richie's simple hash from "The C Programming Language", 1st Editionmid5โ xor shift hash of the middle 5 characters of the string. Designed by Colin Ian Kingmuladd32โ simple multiply and add hash using 32 bit math and xor folding of overflowmuladd64โ simple multiply and add hash using 64 bit math and xor folding of overflowmulxror32โ 32 bit multiply, xor and rotate right. Mangles 32 bits where possible. Designed by Colin Ian Kingmulxror64โ 64 bit multiply, xor and rotate right. 64 Bit version ofmulxror32murmur3_32โ Austin Appleby's Murmur3 hash, 32 bit variantnhashโ exim's nhash.pjwโ a non-cryptographic hash function created by Peter J. Weinberger of AT&T Bell Labs, used in UNIX ELF object filessdbmโ sdbm hash as used in the SDBM database and GNU awksedgwickโ simple hash from Robert Sedgwick's C programming booksobelโ Justin Sobel's bitwise shift hashx17โ multiply by 17 and add. The multiplication can be optimized down to a fast right shift by 4 and add on some architecturesxorโ simple rotate shift and xor of valuesxorror32โ 32 bit exclusive-or with right rotate hash, a fast string hash, designed by Colin Ian Kingxorror64โ 64 bit version ofxorror32xxhashโ 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--aggressiveoption enabled and no--hdd-optsoptions given, the hdd stressor will work through all the--hdd-optoptions 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 is1GB. 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 suffixb,k,morg.--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 thesyncoption.dsyncโ ensure output has been transferred to underlying hardware and file metadata has been updated (using theO_DSYNCopen flag). This is equivalent to eachwrite(2)being followed by a call tofdatasync(2). See also thefdatasyncoption.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 explicitfsync(2)call.fdatasyncโ similar tofsync, but do not flush the modified metadata unless metadata is required for later data reads to be handled correctly. This uses an explicitfdatasync(2)call.iovecโ usereadv/writevmultiple buffer I/Os rather thanread/write. Instead of 1 read/write operation, the buffer is broken into an iovec of16buffers.noatimeโ do not update the file last access timestamp, this can reduce metadata writes.syncโ ensure output has been transferred to underlying hardware (using theO_SYNCopen flag). This is equivalent to eachwrite(2)being followed by a call tofsync(2). See also thefsyncoption.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. Thewr-seqoption 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 examplefadv-willneedcannot be used withfadv-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 ๐ Range0..3600.--hdd-write-size Nโ specify size of each write in bytes. Size can be from1byte to4MB.
๐ง 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 is262144(256ร1024).
๐ธ High resolution timer stressor ๐ธ
--hrtimers Nโ spin upNworkers that go absolutely feral on high resolution timers at a high frequency ๐ . Each stressor literally starts 32 processes running with random timer intervals of0..499999nanoseconds. And bestie, if you run this with the appropriate privilege it'll run them with theSCHED_RRpolicy ๐--hrtimers-adjustโ turns on automatic timer rate adjustment to try to maximize the hrtimer frequency โจ. The signal rate gets measured every0.1seconds 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 afterNtimer event bogo operations ๐ซถ
๐ฆ Hashtable searching (hsearch) stressor ๐ฆ
--hsearch Nโ startNworkers that search an 80% full hash table usinghsearch(3). By default there are8192elements 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 afterNbogo hsearch operations are completed โ--hsearch-size Nโ specify the number of hash entries to be inserted into the hash table. Size can be from1 Kto4 M. No cap on the slay though ๐
๐ Huge page merging and splitting stressor ๐
--hugepage Nโ startNworkers 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 towards2MBhuge pages if supported ๐--hugepage-dontneedโ useMADV_DONTNEEDwhere 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;forwardselects pages working forwards through memory,randomselects pages randomly, andreverseselects pages working in reverse through memory. The default israndom๐--hugepage-num Nโ useNhuge pages for the allocation. The default is just2huge pages per stressor instance ๐--hugepage-opsโ stop afterNrounds of page merging ๐ฆ--hugepage-removeโ useMADV_REMOVEwhere 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โ startNworkers that exercisesinh,cosh, andtanhlibm hyperbolic functions usingfloat,doubleandlong doublefloating point variants. Each function is exercised10000times 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 functionscoshโ 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 afterNbogo-operations ๐ซถ
โญ CPU instruction cache load stressor โญ
--icache Nโ startNworkers that stress the instruction cache by forcing instruction cache reloads ๐ฅ--icache-ops Nโ stop the icache workers afterNbogo icache operations are completed โ--icache-pages Nโ specify the number of pages to use for instruction cache stressing for each stressor instance. The default is1page, range1to1024๐
๐ ICMP flooding stressor ๐
--icmp-flood Nโ startNworkers that flood localhost with randomly sized ICMP ping packets ๐. This stressor requires theCAP_NET_RAWcapability โ no cap, no flooding, periodt ๐--icmp-flood-max-sizeโ use a maximum packet size of65535bytes instead of the default of1000bytes. Absolute unit energy ๐--icmp-flood-ops Nโ stop icmp flood workers afterNICMP ping packets have been sent ๐จ
๐ง Idle page scan stressor (Linux) ๐ง
--idle-page Nโ startNworkers that walk through every page exercising the Linux/sys/kernel/mm/page_idle/bitmapinterface. Requires theCAP_SYS_RESOURCEcapability ๐--idle-page-ops Nโ stop afterNbogo idle page operations ๐ฆ
๐ธ Inode ioctl flags stressor ๐ธ
--inode-flags Nโ startNworkers that exercise inode flags using theFS_IOC_GETFLAGSandFS_IOC_SETFLAGSioctl(2)and inode attributes usingfile_getattr(2)andfile_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, seeioctl_iflags(2)for more details ๐--inode-flags-ops Nโ stop the inode-flags workers afterNioctl flag setting attempts โ
๐ Inotify stressor ๐
--inotify Nโ startNworkers 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 afterNinotify bogo operations ๐
๐ Insertion sort stressor ๐
--insertionsort Nโ startNworkers that sort32bit integers using insertion sort ๐ข--insertionsort-ops Nโ stop insertionsort stress workers afterNbogo insertion sorts โ--insertionsort-size Nโ specify number of32bit integers to sort, default is16384(16 ร 1024) ๐
๐ Integer Math Operations ๐
--intmath Nโ startNworkers that perform addition, subtraction, multiplication, division and modulo math operations on128,64,32,16and8bit signed integers ๐งฎ๐--intmath-fastโ when available useint_fast64_t,int_fast32_t,int_fast16_tandint_fast8_ttypes instead ofint64_t,int32_t,int16_tandint8_ttypes. 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 additionadd64โ 64 bit signed integer additionadd32โ 32 bit signed integer additionadd16โ 16 bit signed integer additionadd8โ 8 bit signed integer additionsub128โ 128 bit signed integer subtractionsub64โ 64 bit signed integer subtractionsub32โ 32 bit signed integer subtractionsub16โ 16 bit signed integer subtractionsub8โ 8 bit signed integer subtractionmul128โ 128 bit signed integer multiplicationmul64โ 64 bit signed integer multiplicationmul32โ 32 bit signed integer multiplicationmul16โ 16 bit signed integer multiplicationmul8โ 8 bit signed integer multiplicationdiv128โ 128 bit signed integer divisiondiv64โ 64 bit signed integer divisiondiv32โ 32 bit signed integer divisiondiv16โ 16 bit signed integer divisiondiv8โ 8 bit signed integer divisionmod128โ 128 bit signed integer modulomod64โ 64 bit signed integer modulomod32โ 32 bit signed integer modulomod16โ 16 bit signed integer modulomod8โ 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 additionaddfast32โ fast 32 bit signed integer additionaddfast16โ fast 16 bit signed integer additionaddfast8โ fast 8 bit signed integer additionsubfast64โ fast 64 bit signed integer subtractionsubfast32โ fast 32 bit signed integer subtractionsubfast16โ fast 16 bit signed integer subtractionsubfast8โ fast 8 bit signed integer subtractionmulfast64โ fast 64 bit signed integer multiplicationmulfast32โ fast 32 bit signed integer multiplicationmulfast16โ fast 16 bit signed integer multiplicationmulfast8โ fast 8 bit signed integer multiplicationdivfast64โ fast 64 bit signed integer divisiondivfast32โ fast 32 bit signed integer divisiondivfast16โ fast 16 bit signed integer divisiondivfast8โ fast 8 bit signed integer divisionmodfast64โ fast 64 bit signed integer modulomodfast32โ fast 32 bit signed integer modulomodfast16โ fast 16 bit signed integer modulomodfast8โ 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 callingsync(2)to commit the buffer cache to disk ๐ซถ. You can totally run this alongside the--hddstressor, they're besties. Heads up though: this is a legacy stressor โ it's the one that plays nice with the originalstresstool, 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 is1 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 suffixb,k,morgโจ--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 of16reads and16writes of ioport0x80. x86 Linux systems only bestie ๐ซถ. And like, I/O performed on x86 platforms on port0x80will 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 bothinandout. So you specify if port reads arein, port read writes areout, or reads and writes areinout๐--ioport-port [ post | vga-dac-r | bochs-debug ]โ select the x86 I/O port to use:post(that's the Power-On-Self-Test port0x80),vga-dac-r(the VGA DAC Red port0x3c8) orbochs-debug(the Bochs debug port0xe9) ๐
๐ IO scheduling class and priority stressor ๐
--ioprio Nโ start N workers that exercise theioprio_get(2)andioprio_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,AVXandAVX512CPU features will be used on data encrypted bySHA,DES,CMAC,CTR,HMAC MD5,HMAC SHA1andHMAC SHA512cryptographic 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 is256.--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 anITIMER_PROFitimer that generates aSIGPROFsignal. The default frequency for the itimer is1 MHz, however the Linux kernel will set this to be no more than the jiffy setting โ so high frequencySIGPROFsignals are not normally possible, ngl ๐ญ. A busy loop spins ongetitimer(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 from1to1000000Hz. Normally the highest frequency is limited by the number of jiffy ticks per second, so running above1000Hz is difficult to attain in practice ๐ซถ--itimer-ops Nโ stop itimer stress workers after N bogo itimerSIGPROFsignals.--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 is512pixels.--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 is1..100(1lowest,100highest), with a default of95โจ--jpeg-width Hโ use a RGB sample image width of H pixels. The default is512pixels.
๐ง 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 are131072integers 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 from1 Kto4 M32 bit integers.
๐ Kcmp stressor (Linux) ๐
--kcmp Nโ start N workers that usekcmp(2)to compare parent and child processes to determine if they share kernel resources ๐. Supported only for Linux, and it requires theCAP_SYS_PTRACEcapability โ 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 usingadd_key(2)andketctl(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_CLEARandKEYCTL_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 sendingSIGUSR1kill(2)signals to aSIG_IGNsignal handler in the stressor, andSIGUSR1kill signals to a child stressor with aSIGUSR1handler ๐. 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 kernelsyslog(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 port0x80in 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 tomlock(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 oflandlock_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 thefcntl(2)F_SETLEASEoperation. 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 generateSIGIOlease breaking notifications to the parent. Heads up: this stressor is only available ifF_SETLEASE,F_WRLCKandF_UNLCKsupport is provided byfcntl(2).--lease-breakers Nโ start N lease breaker child processes per lease worker. Normally one child is plenty to force manySIGIOlease 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/ledsinterfaces 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.
๐ Hardlink stressor ๐
--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 (thealloption).--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 tomlock(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 suffixb,k,morg.
๐ 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 suffixb,k,morg.--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 (seefcntl(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 POSIXlockf(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 blockingF_LOCKlockf(3)commands, use non-blockingF_TLOCKcommands 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 BSDflock(2), locka (advisory), POSIXlockf(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 (peepfcntl(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 methodsclogโ double complex natural logarithmclogfโ float complex natural logarithmcloglโ long double complex natural logarithmlogโ double natural logarithmlogfโ float natural logarithmloglโ long double natural logarithmlogbโ get exponent of a doublelogbfโ get exponent of a floatlogblโ get exponent of a long doublelog10โ double base-10 logarithmlog10fโ float base-10 logarithmlog10lโ long double base-10 logarithmlog2โ double base-2 logarithmlog2fโ float base-2 logarithmlog2lโ long double base-2 logarithm
๐ฆ Long jump (longjmp) stressor
--longjmp Nโ start N workers that exercisesetjmp(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 theCAP_SYS_ADMINcapability โ 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 usinglsearch(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 callslsm_list_modules(2)andlsm_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 randommadvise(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 suffixb,k,morg.--madvise-hwpoisonโ enableMADV_HWPOISONpage 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 callingmalloc(3),calloc(3),realloc(3),posix_memalign(3),aligned_alloc(3),memalign(3)andfree(3). By default up to 65536 allocations can be active at any point, but you can change that with the--malloc-maxoption. 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-bytesoption, 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 suffixb,k,morg. Large allocation sizes cause the memory allocator to usemmap(2)rather than expanding the heap usingbrk(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 tomlock(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 successfulmalloc(3),calloc(3),realloc(3),posix_memalign(3),aligned_alloc(3)ormemalign(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 usesmmap(2)instead ofsbrk(2)to allocate more memory. This is only available on systems that provide the GNU Cmallopt(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 supportmalloc_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 methodsaddโ add two N ร N matricescopyโ copy one N ร N matrix to anotherdivโ divide an N ร N matrix by a scalarfrobeniusโ Frobenius product of two N ร N matriceshadamardโ Hadamard product of two N ร N matricesidentityโ create an N ร N identity matrixmeanโ arithmetic mean of two N ร N matricesmultโ multiply an N ร N matrix by a scalarnegateโ negate an N ร N matrixprodโ product of two N ร N matricessubโ subtract one N ร N matrix from another N ร N matrixsquareโ multiply an N ร N matrix by itselftransโ transpose an N ร N matrixzeroโ 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 methodsaddโ add two N ร N ร N matricescopyโ copy one N ร N ร N matrix to anotherdivโ divide an N ร N ร N matrix by a scalarfrobeniusโ Frobenius product of two N ร N ร N matriceshadamardโ Hadamard product of two N ร N ร N matricesidentityโ create an N ร N ร N identity matrixmeanโ arithmetic mean of two N ร N ร N matricesmultโ multiply an N ร N ร N matrix by a scalarnegateโ negate an N ร N ร N matrixsubโ subtract one N ร N ร N matrix from another N ร N ร N matrixtransโ transpose an N ร N ร N matrixzeroโ 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 themembarrier(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 usingmemcpy(3)and then move the data in the buffer withmemmove(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 methodslibcโ use libc memcpy and memmove functions, this is the defaultbuiltinโ use the compiler built in optimized memcpy and memmove functionsnaiveโ use naรฏve byte by byte copying and memory moving build with default compiler optimization flagsnaive_o0โ use unoptimized naรฏve byte by byte copying and memory movingnaive_o1โ use unoptimized naรฏve byte by byte copying and memory moving with-O1optimizationnaive_o2โ use optimized naรฏve byte by byte copying and memory moving build with-O2optimization and where possible use CPU specific optimizationsnaive_o3โ use optimized naรฏve byte by byte copying and memory moving build with-O3optimization 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 of1024pages usingmemfd_create(2)andftruncate(2)for allocation andmmap(2)to map the allocation into the process address space. (Linux only ๐ง).--memfd-bytes Nโ allocates N bytes per memfd stress worker, the default is256MB. You can specify the size as a % of total available memory, or in units of Bytes, KBytes, MBytes and GBytes using the suffixb,k,morg๐--memfd-fds Nโ creates N memfd file descriptors, the default is256. With this option you can select8to4096memfd 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 tomlock(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 Nmemfd-create(2)bogo operations โญ--memfd-zap-pteโ exercises zapping page-table-entries to try to reproduce a Linux kernel bug that was fixed by commit5abfd71d936a8aefd9f9ccd299dea7a164a5d455"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 requiresCAP_SYS_ADMINcapabilities ๐--memhotplug-mmapโ enables random1K to1MB 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 with1024,512,256,128,64,32,16and8bit reads and writes ๐ค. Let me break it down bestie:1024,512and256reads and writes are available with compilers that support integer vectors.- x86-64 CPUs that support uncached (non-temporal "nt") writes also exercise
128,64and32writes, providing higher write rates than the normal cached writes ๐ฅ - x86-64 also exercises repeated string stores using
64,32,16and8bit writes. - CPUs that support prefetching reads also exercise
64prefetched "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 is256MB. You can specify the size in units of Bytes, KBytes, MBytes and GBytes using the suffixb,k,morg, or with cache sizesL1,L2,L3orLLC(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 methodsread128ntโ read 128 bits per read using non-temporal loadread128pfโ read 128 bits per read using prefetchingread64pfโ read 64 bits per read using prefetchingread1024โ read a vector of 1024 bits per readread512โ read a vector of 512 bits per readread256โ read a vector of 256 bits per readread128โ read 128 bits per readread64โ read 64 bits per readread32โ read 32 bits per readread16โ read 16 bits per readread8โ read 8 bits per readwrite64stoqโ write 64 bits per write with x86rep stoqwrite32stowโ write 32 bits per write with x86rep stowwrite16stodโ write 16 bits per write with x86rep stodwrite8stobโ write 8 bits per write with x86rep stobwrite64dsโ write 64 bits per write with x86movdiriwrite128ntโ write 128 bits per write using non-temporal storewrite64ntโ write 64 bits per write using non-temporal storewrite32ntโ write 32 bits per write using non-temporal storewrite1024โ write a vector of 1024 bits per writewrite512โ write a vector of 512 bits per writewrite256โ write a vector of 256 bits per writewrite128โ write 128 bits per writewrite64โ write 64 bits per writewrite32โ write 32 bits per writewrite16โ write 16 bits per writewrite8โ write 8 bits per writememsetโ write using libcmemset--memrate-ops Nโ stop after N bogo memrate operations. short and sweet, periodt.--memrate-rd-mbs Nโ specify the maximum allowed read rate inMB/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 inMB/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 a16 MBbuffer 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 methodschunk1โ memset 1 byte chunks of random data into random locationschunk8โ memset 8 byte chunks of random data into random locationschunk64โ memset 64 byte chunks of random data into random locationschunk256โ memset 256 byte chunks of random data into random locationschunkpageโ memset page size chunks of random data into random locationscopy128โ 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 locationsflushโ flush cache line in random locationslockโ lock randomly choosing locations (Intel x86 and ARM CPUs only)matrixโ treat memory as a 2 ร 2 matrix and swap random elementsmemmoveโ copy all the data in buffer to the next memory locationmemsetโ memset the memory with random datamemset64โ memset the memory with a random 64 bit value in 64 byte chunks using non-temporal stores if possible or normal stores as a fallbackmemsetstosdโ memset the memory using x86 32 bitrep stosdinstruction (x86 only)mfenceโ stores with write serializationnumaโ memory bind pages across numa nodesprefetchโ prefetch data at random memory locationsrandomโ randomly run any of the memthrash methods except forrandomandallreverseโ swap 8 bit values from start to end and work towards the middlespinreadโ spin loop read the same random location2โ19timesspinwriteโ spin loop write the same random location2โ19timesswapโ step through memory swapping bytes in steps of 65 and 129 byte stridesswap64โ work through memory swapping adjacent 64 byte chunksswapfwdrevโ 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 BSDmergesort(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 is262144(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 ofopen, 256lseeks and writes,fdatasync,close,fsyncand thenstat,open, 256lseeks, reads, occasional file memory mapping,close,unlinkandlstat. the chaotic little syscall parade of it all.--metamix-bytes Nโ set the size of metamix files, the default is1 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 suffixb,k,morg.--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 usingmincore(2). It also maps and unmaps a page to check if the page is mapped or not usingmincore(2).--mincore-ops Nโ stop after N mincore bogo operations. One mincore bogo op is equivalent to a 300mincore(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. specifying10000will select8192nanoseconds.--min-nanosleep-sched [ batch | deadline | ext | fifo | idle | other | rr ]โ select scheduling policy. Note thatdeadline,fifoandrrrequire root privilege.
root privilege check, bestie:deadline,fifoandrrare 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 in8 ร 16 bits,4 ร 32 bits,2 ร 64 bitsand1 ร 128 bitsat 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 causeSIGBUS,SIGILLorSIGSEGV, 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 readsint16wrโ 8 ร 16 bit integer writesint16incโ 8 ร 16 bit integer incrementsint16atomicโ 8 ร 16 bit atomic integer incrementsint32rdโ 4 ร 32 bit integer readsint32wrโ 4 ร 32 bit integer writesint32wtntโ 4 ร 32 bit non-temporal stores (x86 only, bestie)int32incโ 4 ร 32 bit integer incrementsint32atomicโ 4 ร 32 bit atomic integer incrementsint64rdโ 2 ร 64 bit integer readsint64wrโ 2 ร 64 bit integer writesint64wrdsโ 4 ร 64 bit direct stores (x86 only)int64wtntโ 4 ร 64 bit non-temporal stores (x86 only)int64incโ 2 ร 64 bit integer incrementsint64atomicโ 2 ร 64 bit atomic integer incrementsint128rdโ 1 ร 128 bit integer readsint128wrโ 1 ร 128 bit integer writesint128incโ 1 ร 128 bit integer incrementsint128atomicโ 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/unlink stressor ๐
--mknod Nโ start N workers that create and remove fifos, empty files and named sockets usingmknod(2)andunlink(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 usingmlock(2),munlock(2),mlockall(2)andmunlockall(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 of262144mappings are made. Next, all future mappings are mlocked and the worker attempts to map262144pages, 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 of1024child processes in total; each child will attempt to anonymouslymmap(2)andmlock(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 of1024child 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 callingmmap(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 ๐ TheMAP_POPULATEoption is used to populate pages into memory on systems that support this. By default, anonymous mappings are used, however, the--mmap-fileand--mmap-asyncoptions 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 is256 MB. One can specify the size as % of total available memory or in units of Bytes, KBytes, MBytes and GBytes using the suffixb,k,morg.--mmap-fileโ enable file based memory mapping and by default use synchronous msync'ing on each page.--mmap-madviseโ enable randomizedmadvise(2)settings on pages.--mmap-mergeableโ mark pages as mergeable viamadvise(2)where possible.--mmap-mlockโ attempt tomlock(2)mmap'd pages into memory causing more memory pressure by preventing pages from swapped out.--mmap-mmap2โ usemmap2(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 useO_DIRECTdirect I/O.--mmap-ops Nโ stop mmap stress workers after N bogo operations.--mmap-osyncโ enable file based memory mapping and useO_SYNCsynchronous 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 tomlock(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 usemadvise(2)MADV_FREE(if it is available) to indicate the page is free--mmapcow-mlockโ attempt tomlock(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 off32child 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 withmadvise(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โ mmapsNbytes 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 suffixb,k,morgโจ--mmapfork-ops Nโ stop afterNmmapfork bogo operations, periodt ๐--mmapfork-procs Nโ how many child processes per worker to fork. Range is1to256, default is32๐
๐ Memory map files stressor ๐
--mmapfiles Nโ startNworkers that attempt to memory map and then unmap up to512 ร 1024files into memory ๐ญ it literally just traverses/lib,/lib32,/lib64,/boot,/bin,/etc,/sbin,/usr,/var,/sysand/procand 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 afterNmemory map/unmap operations ๐ธ--mmapfiles-populateโ default behaviour is to do a memory mapping and not fault any pages into physical memory. This option usesMAP_POPULATEwhen 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โ startNworkers that perform fixed address allocations from the top virtual address down to128 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 tomlock(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 afterNmmapfixed memory mapping bogo operations ๐
๐ Huge page memory mapping stressor ๐
--mmaphuge Nโ startNworkers that attempt to mmap a set of huge pages and large huge-page-sized mappings. Successful mappings are madvised withMADV_NOHUGEPAGEandMADV_HUGEPAGEsettings, and then1/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 default8192mappings are attempted per round of mappings, or until swapping is detected ๐--mmaphuge-fileโ attempt to mmap on a16 MBtemporary file and random4 Koffsets. If this fails, anonymous mappings are used instead ๐ง--mmaphuge-mlockโ attempt tomlock(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 is8192mappings โจ--mmaphuge-numaโ assign memory mapped pages to randomly selected NUMA nodes. Disabled for systems that do not support NUMA ๐--mmaphuge-ops Nโ stop afterNmmaphuge bogo operations ๐ฅ
๐ Maximum memory mapping per process stressor ๐
--mmapmany Nโ startNworkers 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 permap()/munmap()cycle ๐--mmapmany-mlockโ attempt tomlock(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 afterNmmapmany bogo operations โญ
๐ Memory map random mapping operations ๐
--mmaprandom Nโ startNworkers 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 exercisesmmap(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 afterNrandom 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 is1024, range1to65536๐--mmaprandom-maxpages Nโ select maximum number of pages to be memory mapped, default is8, range2to1024. The pages mapped are randomly chosen from1to 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โ startNworkers that exercise memory mapping operations on a shared file ๐ฅ mappings of various random sizes are tortured with calls tomadvise(2),mremap(2),mprotect(2),msync(2),mlock(2),munlock(2),mseal(2)andmincore(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โ allocateNbytes in total for all the mmaptorture stressor instances, default is256 MB๐ซถ you can specify the size as a%of total available memory or in units of Bytes, KBytes, MBytes and GBytes using the suffixb,k,morgโจ--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 is10%. Specifying zero will disable msync'ing ๐--mmaptorture-ops Nโ stop afterNiterations of memory mapping torture operations ๐ธ
๐ง Kernel module loading stressor (Linux) ๐ง
--module Nโ startNworkers that usefinit_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 kerneltools/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 thefinit_module()system call even if the module is already loaded, testing races that are otherwise hard to reproduce ๐ฅ--module-name NAMEโNAMEof the module to use, for example:test_module,xfs,ext4โจ by defaulttest_moduleis used soCONFIG_TEST_LKMmust be enabled in the kernel. The module dependencies must be loaded prior to running these stressor tests, as this stresses runningfinit_module()not using modprobe ๐--module-no-modverโ ignore module modversions when usingfinit_module()๐--module-no-vermagโ ignore module versions when usingfinit_module()๐ฆ--module-no-unloadโ do not unload the module right after loading it withfinit_module()โญ--module-ops Nโ stop afterNmodule load/unload cycles ๐
๐ Monte Carlo computations of ฯ and e and various integrals stressor ๐
--monte-carlo Nโ startNstressors 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 methodseโ compute Euler's constanteexpโ integrateexp(x โ 2)forx = 0..1piโ compute ฯ from the area of a circlesinโ integratesin(x)forx = 0..ฯsqrtโ integratesqrt(1 + x โ 4)forx = 0..1squircleโ area of a unit squirclex โ 4 + y โ 4 = 1--monte-carlo-ops Nโ stop afterNMonte 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 generatorsarc4โ use the libc cryptographically-secure pseudorandomarc4random(3)number generator.drand48โ use the libc linear congruential algorithmdrand48(3)using 48-bit integer arithmetic.getrandomโ use thegetrandom(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 libcrandom(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 ฯ ore, default is100000. ๐ฒ
๐งฎ Multi-precision floating operations (mpfr) stressor
--mpfr Nโ startNworkers 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 of1/(n โ 3).cosineโ computecos(ฮธ)forฮธ = 0to2ฯin 100 steps.eulerโ computeeusingn = (1 + (1 รท n)) โ n.expโ compute 1000 exponentials.logโ compute 1000 natural logarithms.omegaโ compute the omega constant defined byฮฉeโฮฉ = 1using efficient iteration ofฮฉn+1 = (1 + ฮฉn) / (1 + eโฮฉn).phiโ compute the Golden Ratio ฯ using series.sineโ computesin(ฮธ)forฮธ = 0to2ฯin 100 steps.nsqrtโ compute square root using Newton-Raphson.
--mpfr-ops Nโ stop workers afterNiterations of various multi-precision floating point operations.--mpfr-precision Nโ specify the precision in binary digits of the floating point operations. Default is1000bits, and the allowed range is32to1000000โ and yes, the high end is very slow ๐ you've been warned.
๐ก๏ธ Memory protection stressor
--mprotect Nโ startNworkers that exercise changing page protection settings and accessing memory after each change.8processes 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 afterNmprotectcalls.
๐ฌ POSIX message queue stressor (Linux)
--mq Nโ startNsender and receiver processes that continually send and receive messages using POSIX message queues. (Linux only, bestie ๐ง)--mq-ops Nโ stop afterNbogo POSIX message send operations completed.--mq-size Nโ specify size of POSIX message queue. Default size is10messages, 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โ startNworkers continuously callingmmap(2),mremap(2)andmunmap(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 allocateNbytes per remap stress worker, default is256MB. You can specify the size in units of Bytes, KBytes, MBytes and GBytes using the suffixb,k,morg.--mremap-mlockโ attempt tomlock(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 afterNbogo operations.
๐ Memory Sealing
--mseal Nโ startNmemory sealing stressors that exercisemadvise(2),mremap(2),mprotect(2)andmseal(2)operations on two pages of memory mapped anonymous private memory. Linux 6.10+ kernels only โ no vintage vibes allowed ๐--mseal-ops Nโ stop afterNmsealed memory operations.
๐จ System V message IPC stressor
--msg Nโ startNsender 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. Range4to8192bytes, default is4bytes.--msg-ops Nโ stop afterNbogo message send operations completed.--msg-types Nโ select the quality of message types (mtype) to use. By default,msgsndsends messages with amtypeof1; this option lets you send messages types in the range1..Nto exercise the message queue receive ordering. Heads up: this will also impact throughput performance. ๐ซ
๐ Synchronize file with memory map (msync) stressor
--msync Nโ startNstressors thatmsyncdata from a file backed memory mapping from memory back to the file, andmsyncmodified data from the file back to the mapped memory. This exercises themsync(2)MS_SYNCandMS_INVALIDATEsync operations.--msync-bytes Nโ allocateNbytes for the memory mapped file, default is256MB. You can specify the size as%of total available memory, or in units of Bytes, KBytes, MBytes and GBytes using the suffixb,k,morg.--msync-ops Nโ stop afterNmsync bogo operations completed.
๐ช Synchronize file with memory map (msync) coherency stressor
--msyncmany Nโ startNstressors that memory map up to32768pages on the same page of a temporary file, change the first32bits in a page andmsyncthe data back to the file. The other32767pages are examined to see if the 32 bit check value is msync'd back to these pages. detective mode: activated ๐ต๏ธโโ๏ธ--msyncmany-ops Nโ stop afterNmsync calls in the msyncmany stressors are completed.
๐งต ISO C mtx (mutex) stressor
--mtx Nโ startNstressors that exercise ISO C mutex locking and unlocking.--mtx-ops Nโ stop afterNbogo mutex lock/unlock operations.--mtx-procs Nโ by default2threads are used for locking/unlocking on a single mutex. This option lets you change that default to2to64concurrent threads.
๐บ๏ธ Unmapping shared non-executable memory stressor (Linux)
--munmap Nโ startNstressors 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 afterNpage unmappings.
๐ Pthread mutex stressor
--mutex Nโ startNstressors that exercise pthread mutex locking and unlocking. If run with enough privilege then the FIFO scheduler is used and a random priority between0and80%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 afterNbogo mutex lock/unlock operations.--mutex-procs Nโ by default2threads are used for locking/unlocking on a single mutex. This option lets you change that default to2to64concurrent threads.
โฐ High resolution and scheduler stressor via nanosleep calls
--nanosleep Nโ startNworkers that each run pthreads that callnanosleep(2)with random delays from1to2โ18nanoseconds. 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 1so you're exercising fewer concurrent nanosleeps and letting the CPUs actually drop into those deep C states ๐ดโจrandomโ uses random nanosecond durations between1and2โ18nanoseconds ๐ฒnsโ uses1ns(nanosecond) nanosleepsusโ uses1ฮผs(microsecond) nanosleepsmsโ uses1ms(millisecond) nanosleeps--nanosleep-ops Nโ stop the nanosleep stressor afterNbogo nanosleep operations.--nanosleep-threads Nโ specifies how many concurrent pthreads run per stressor. Default is8, allowed range is1to1024. ๐
๐ฐ๏ธ Netlink... no wait, Network device ioctl stressor ๐ป
--netdev Nโ startNworkers that go absolutely feral on the variousnetdeviceioctl(2)commands across all the available network devices. The exact ioctls getting exercised are:SIOCGIFCONF,SIOCGIFINDEX,SIOCGIFNAME,SIOCGIFFLAGS,SIOCGIFADDR,SIOCGIFNETMASK,SIOCGIFMETRIC,SIOCGIFMTU,SIOCGIFHWADDR,SIOCGIFMAPandSIOCGIFTXQLEN. Seenetdevice(7)for more deets on these ioctl commands ๐--netdev-ops Nโ stop afterNnetdev bogo operations are completed.
๐ง Netlink proc stressor (Linux)
--netlink-proc Nโ startNworkers 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 needsCAP_NET_ADMINcapability, no cap ๐งข--netlink-proc-ops Nโ stop the proc netlink connector stressors afterNbogo ops.
๐ง Netlink task stressor (Linux)
--netlink-task Nโ startNworkers that collect task statistics via the netlink taskstats interface. Again: Linux only, and it requiresCAP_NET_ADMINcapability ๐--netlink-task-ops Nโ stop the taskstats netlink connector stressors afterNbogo ops.
๐ Nice stressor
--nice Nโ startNCPU-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 for0.1seconds per level, and then exits. It's giving "polite but make it stressful" ๐ซถ--nice-ops Nโ stop afterNnice bogo nice loops.
๐ซ NO-OP CPU instruction stressor
--nop Nโ startNworkers 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 afterNno-op bogo operations. Each bogo-operation is equivalent to256loops of256no-op instructions. Math girlies rise ๐
๐ณ๏ธ /dev/null stressor
--null Nโ startNworkers that exercise/dev/nullwithwrite(2),lseek(2),ioctl(2),fcntl(2),fallocate(2)andfdatasync(2)calls. If you just want/dev/nullwrite benchmarking, use the--null-writeoption instead ๐--null-ops Nโ stop null stress workers afterN/dev/nullbogo operations.--null-writeโ just write to/dev/nullwith4 Kwrites, with no additional exercising on/dev/null. Pure, unfiltered, no thoughts head empty ๐
๐ง Migrate memory pages over NUMA nodes stressor
--numa Nโ startNworkers that migrate stressors and a4 MBmemory mapped buffer around all the available NUMA nodes. This usesmigrate_pages(2)to move the stressors, andmbind(2)andmove_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 is4 MBper worker. You can give the size as a%of total available memory, or in units of Bytes, KBytes, MBytes and GBytes using the suffixb,k,morg๐--numa-ops Nโ stop NUMA stress workers afterNbogo NUMA operations.--numa-shuffle-addrโ shuffle page order for the address list when callingmove_pages(2)๐--numa-shuffle-nodeโ shuffle node order for the address list when callingmove_pages(2)๐
๐ฆ NUMA page copying stressor
--numacopy Nโ startNworkers 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 occurs20times 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 ]โ selectmbindmode options; seembind(2)for an explanation of these modes ๐--numacopy-ops Nโ stop afterNNUMA copy bogo-operations. One bogo operation is100copies of pages to/from every node to every node. That's a lot of copying bestie ๐ญ
๐ช Large pipe stressor
--oom-pipe Nโ startNworkers 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--aggressivemode 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 afterNbogo pipe expand/shrink operations.
โ ๏ธ Illegal instructions stressors
--opcode Nโ startNworkers 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 from0x00000000to0xfffffffinclusive.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 thestress-ngtext segment and randomly flips single bits in a random choice of 1/8th of the code.
--opcode-ops Nโ stop afterNattempts to execute illegal code.
๐ Opening file (open) stressor
-o N,--open Nโ startNworkers that performopen(2)and thenclose(2)operations on/dev/zero. The maximum opens at one time is system defined, so the test will run up to this maximum, or65536open file descriptors โ whichever comes first ๐--open-fdโ run a child process that scans/proc/$PID/fdand 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 ofNfiles (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 afterNbogo open operations.
๐ OpenVPN DCO kernel driver stressor (Linux)
--ovpn Nโ spin upNworkers 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 withgetrandom(2). Every successfully completed command loop = one bogo op. Heads up bestie: this stressor needs theovpnkernel module loaded,libnl-3present at build time, and theCAP_NET_ADMINcapability. No skips. โจ--ovpn-ops Nโ stop the ovpn stressors afterNbogo 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 avethpair (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โ startNworkers thatmmapa memory region (default4 MB) and then shuffle pages to the virtual address of the previous page. Each page shuffle uses3mremapoperations 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 suffixb,k,morg. ๐ฆ--pagemove-mlockโ attempt tomlock(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 afterNpagemove shuffling operations, where shuffling all the pages in the mmap'd region counts as1bogo-operation.
๐ธ Page scattered mappings
--pagescatter Nโ startNworkers that exercise memory mapping of batches of single pages at randomly chosen addresses. Where possible, theMAP_FIXED_NOREPLACEorMAP_FIXEDmmap(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 toPROT_NONEviamprotect(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 afterNbogo page mmapping operations.--pagescatter-order Nโ attempt to map and use2โNmaximum 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โ startNworkers that exercise page swap in and swap out. Pages are allocated and paged out usingmadvise(2)MADV_PAGEOUT. When the maximum per-process number of mmaps is reached, or65536pages are allocated, the pages are read to page them back in and unmapped in reverse mapping order. Full circle moment. ๐ซ--pageswap-ops Nโ stop afterNpage allocation bogo operations.--pageswap-pages Nโ specify the maximum number of pages to be mmap'd per instance; range1to1048576. The default is65536pages.
๐ป PCI sysfs stressor (Linux)
--pci Nโ exercise PCI sysfs by runningNworkers 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 namexxxx:xx:xx.xwherexis a hexadecimal digit.--pci-ops Nโ stop pci stress workers afterNPCI 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โ startNworkers that attempt to set personality and get all the available personality types (process execution domain types) via thepersonality(2)system call. (Linux only.)--personality-ops Nโ stop personality stress workers afterNbogo personality operations.
๐ Mutex using Peterson algorithm stressor
--peterson Nโ startNworkers 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_synchronizeif 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 afterNmutex operations.
โญ Page mmap stressor
--physpage Nโ startNworkers that use/proc/self/pagemapand/proc/kpagecountto 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 theCAP_SYS_ADMINcapability. ๐--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 afterNbogo physical address lookups.
๐ Physical page mmap stressor (using /dev/mem)
--physmmap Nโ startNworkers that try to mmap available System RAM (as specified by/proc/iomem) using/dev/memand randomized private or shared pages. This requiresCAP_SYS_ADMINcapabilities to fully read/proc/iomemand 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 afterNbogo mmap attempts.--physmmap-readโ perform64bit reads of all the data in each mmap'd page.
๐ฆ Process signals (pidfd_send_signal) stressor
--pidfd Nโ startNworkers that exercise signal sending via thepidfd_send_signal(2)system call. This stressor creates child processes and checks if they exist and can be stopped, restarted and killed using thepidfd_send_signal(2)system call. Main character energy for real. ๐--pidfd-ops Nโ stop pidfd stress workers afterNchild processes have been created, tested and killed withpidfd_send_signal.
๐ Localhost ICMP (ping) stressor
--ping-sock Nโ startNworkers that send small randomized ICMP messages to the localhost across a range of ports (1024..65535) using a "ping" socket with anAF_INETdomain, aSOCK_DGRAMsocket type and anIPPROTO_ICMPprotocol. Pinging urself, honestly iconic. ๐--ping-sock-ops Nโ stop the ping-sock stress workers afterNICMP messages are sent.--ping-sock-max-size Nโ specify the maximum data size in bytes, with the range9to65515and the default as12.
๐ 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 thanRLIMIT_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 suffixb,k,morg. ๐ธ--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 usingio-uringto register the mapped memory withIORING_REGISTER_BUFFERS. Themadvisemethod usesmadvise(2) MADV_POPULATE_WRITEto enfore pages to be populated. Themlockmethod usesmlock(2)to lock pages. Andalluses all the three methods (if available). Iconic little menu, ngl ๐--pinmem-ops Nโ stop afterNmemory pin/unpin operations, periodt.
๐ Large pipe stressor
-p N,--pipe Nโ startNworkers 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 afterNbogo pipe write operations.--pipe-readers Nโ specify number of child reader processes reading on the pipe, default is1.--pipe-size Nโ specifies the size of the pipe in bytes (for systems that support theF_SETPIPE_SZfcntl()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 version0.15.11the default size is4096bytes โญ--pipe-writers Nโ specify number of child writer processes writing on the pipe, default is1.--pipe-vmspliceโ usevmsplice(2)to splice data pages to/from pipe. Requires pipe packet mode usingO_DIRECTand buffer twice the size of the pipe to ensure verification data sequences. Fancy syscall behaviour, no cap ๐
๐ซ Shared pipe stressor
--pipeherd Nโ startNworkers that pass a 64 bit token counter to/from100child 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 afterNbogo pipe write operations.--pipeherd-procs Nโ specify the number of child processes per stressor instance that share a pipe, range from8to1024. The default is100.--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โ startNworkers that change memory protection using a protection keypkey(2)and thepkey_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-1will be used (and the kernel will use the normalmprotectmechanism 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 afterNpkey_mprotectpage protection cycles.
๐งฉ Stress-ng plugin stressor
--plugin Nโ startNworkers that run user provided stressor functions loaded from a shared library. The shared library can contain one or more stressor functions prefixed withstress_in their name. By default the plugin stressor will find all functions prefixed withstress_in their name and exercise these one by one in a round-robin loop, but a specific stressor can be selected using the--plugin-methodoption. The stressor function takes no parameters and returns0for 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 performs10000nop 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 leadingstress_prefix. Just the function's given name, bestie ๐--plugin-ops Nโ stop afterNiterations 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โ startNworkers that perform zero timeout polling via thepoll(2),ppoll(2),select(2),pselect(2)andsleep(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 topoll/ppoll/select/pselecton. The maximum number forselect/pselectis limited byFD_SETSIZEand 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 afterNbogo poll operations.--poll-random-us Nโ use a random timeout ofNmicroseconds forppoll(2)andpselect(2)calls instead of the default of20000microseconds.
๐งฎ Power maths functions
--powmath Nโ startNworkers that exercise variouslibmpower functions with input values0to1in steps of0.001; the results are sanity checked to ensure no variation occurs after each round of10000computations. Math girl summer ๐ฅ--powmath-ops Nโ stop afterNpower 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 methodscpowโ complex double power functioncpowfโ complex float power functioncpowlโ complex long double power functioncsqrtโ 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 functionpowfโ float power functionpowlโ long double power functionsqrtโ 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โ startNworkers that exercise the majority of theprctl(2)system call options. Each batch ofprctlcalls is performed inside a new child process to ensure the limit ofprctlis contained inside a new process every time. Someprctloptions 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 afterNbatches of prctl calls
๐๏ธ L3 cache prefetching stressor
--prefetch Nโ startNworkers that benchmark prefetch and non-prefetch reads of a L3 cache sized buffer. The buffer is read with loops of8 ร 64bit reads per iteration. In the prefetch cases, data is prefetched ahead of the current read position by various sized offsets, from64bytes to8 Kto 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 locality0hintbuiltinl3โ same__builtin_prefetch(3)function, but with a locality3hintdcbtโ uses the ppc64dcbtinstruction to fetch data into the L1 cache (ppc64 only)dcbtstโ uses the ppc64dcbtstinstruction to fetch data into the L1 cache (ppc64 only)prefetcht0โ uses the x86prefetcht0instruction to prefetch data into all levels of the cache hierarchy (x86 only)prefetcht1โ uses the x86prefetcht1instruction (temporal data with respect to first level cache) to prefetch data into level 2 cache and higher (x86 only)prefetcht2โ uses the x86prefetcht2instruction (temporal data with respect to second level cache) to prefetch data into level 2 cache and higher (x86 only)prefetchntaโ uses the x86prefetchntainstruction (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 aarch64prfminstruction with thepld1keepoperation (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 aarch64prfminstruction with thepld1keepoperation (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 aarch64prfminstruction with thepld1keepoperation (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 aarch64prfminstruction with thepld1strmoperation (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 aarch64prfminstruction with thepld1strmoperation (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 aarch64prfminstruction with thepld1strmoperation (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 afterNbenchmark operations ๐
โจ Prime number search (using large integers) stressor โจ
--prime Nโ startNworkers that go hunting for prime numbers using the GNU Multiple Precision Arithmetic Library for large integers. The GMPmpz_nextprimefunction 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 isinc. 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 by2. This grows very slowly ๐pwr2โ start of search based on powers of2. Grows relatively quickly โกpwr10โ start of search based on powers of10. Grows by1digit per iteration and grows quickly ๐
--prime-ops Nโ stop after findingNprime numbers--prime-progressโ show the number of primes found and the length of the largest prime found. This gets displayed either every60seconds, or more than60seconds if it takes longer to find the next prime ๐--prime-start Nโ start the prime search from valueN. You can express the value as an integer value or as a floating point value (e.g.1e200to express a very large starting value) ๐
โจ Priority inversion stressor โจ
--prio-inv Nโ startNworkers 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 afterNbogo 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 deadlocknoneโ 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,idleandother) can be selected as an unprivileged user, however "Real Time" policies (fifoandrr) can only be selected with the appropriate privilege. By defaultfifois selected but it will fall back tootherfor unprivileged users ๐ซถ
โจ Privileged CPU instructions stressor โจ
--priv-instr Nโ startNworkers that exercise various architecture specific privileged instructions that cannot be executed by userspace programs. These instructions will be trapped and processed bySIGSEGVorSIGILLsignal handlers ๐--priv-instr-ops Nโ stoppriv-instrstressors afterNrounds of executing privileged instructions
โจ /proc stressor โจ
--procfs Nโ startNworkers that read files from/procand recursively read files from/proc/self(Linux only) ๐ง--procfs-ops Nโ stop procfs reading afterNbogo 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โ startNworkers that exercisepwrite(2)andpread(2)withlseek(2)positioning tests. Each worker has 4 sub-processes that perform repeatedpwriteandpreadoperations using the same shared file descriptor. Two of the processes are started using pthreads (if available), another two processes are started withfork(2). Usingpwriteandpreadshould perform I/O without altering the shared file descriptor file offset. The main worker process performs I/O usinglseek(2)/write(2)andlseek(2)/read(2)calls that change the file offset; lseeks are sanity checked to see if they are being altered bypwriteandpreadcalls ๐--pseek-io-size Nโ specify size of each write/read I/O operation in bytes. Size can be from1byte to1MB ๐--pseek-ops Nโ stop afterNwrites 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โ startNworkers that iteratively creates and terminates multiple pthreads (the default is1024pthreads 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โ createNpthreads 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 afterNbogo pthread create operations
โจ Ptrace stressor โจ
--ptrace Nโ startNworkers that fork and trace system calls of a child process usingptrace(2)๐--ptrace-ops Nโ stop ptrace workers afterNbogo 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 ptyioctl(2)calls on the ptys before closing them again ๐ซถ.--pty-max Nโ try to open a maximum of N pseudoterminals; the default is65536. The allowed range for this setting is8..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 usingqsort(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 is262144(256 ร 1024).
๐ธ Quota stressor
--quota Nโ start N workers that exercise theQ_GETQUOTA,Q_GETFMT,Q_GETINFO,Q_GETSTATSandQ_SYNCquotactl(2)commands on all the available mounted block based file systems. RequiresCAP_SYS_ADMINcapability 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 value1..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 usingradixsort(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 is262144(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 traditionalmount(2)andumount(2)system call as well as the newer Linux 5.2fsopen(2),fsmount(2),fsconfig(2)andmove_mount(2)system calls if they are available. The default ram file system size is2 MB.--ramfs-fillโ fill ramfs with zero'd data usingfallocate(2)if it is available, or multiple calls towrite(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-methodoption). 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,100000items 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 is64bytes 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. RequiresCAP_NET_RAWto 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 of1024to65535). The default port is port45000.
๐ 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. RequiresCAP_NET_RAWto 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 of1024to65535). The default port is port49920.--rawpkt-rxring Nโ setup raw packets with RX ring with N number of blocks, this selectsTPACKET_V. N must be one of1,2,4,8or16.
โญ 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. RequiresCAP_NET_RAWto 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 of1024to65535). The default port is port50176.
๐ฒ 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 therdrandinstruction on Intel x86 processors, or thedarninstruction 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โ usesrdseedinstead ofrdrand. 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 withreadahead(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 suffixb,k,morg. Slay, units ๐ฆ--readahead-ops Nโ stop the readahead stress workers after N bogo read operations.
๐ Reboot stressor
--reboot Nโ starts N workers that exercise thereboot(2)system call. When possible, it creates a process in a PID namespace and performs arebootpower 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 callremap_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 tomlock(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 policiesSCHED_OTHER,SCHED_BATCHandSCHED_IDLEare set, and asched_yield(2)occurs to force heavy rescheduling activity. When the-vverbose 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 reschedulingsched_yieldcalls.
๐งบ 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 tomlock(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--aggressiveoption enabled without any--revio-optsoptions, the revio stressor will work through all the--revio-optoptions 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 suffixb,k,morg.--revio-opts listโ specify various stress test options as a comma separated list. Options are the same as--hdd-optsbut 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 usingpollto 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 usingreadandwritesystem calls. If thesplicesystem 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โ enablespliceto move data between pipes (only ifsplice()is available). ๐ง
๐ง Rlimit stressor
--rlimit Nโ starts N workers that exceed resource limits via settingrlimit(2)and trying to exceed these limits, generatingSIGXCPU,SIGXFSZandSIGSEGVsignals. she's breaking the rules on purpose, periodt ๐--rlimit-ops Nโ stop after N bogo resource limitedSIGXCPU,SIGXFSZandSIGSEGVsignals 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 synchronouslymsync'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 withaccess(2),read(2),lstat(2),listxattr(2),mmap(2),lseek(2),flock(2)andstatx(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. Theallmethod 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 bitror8โ 8 bit unsigned rotate right by 1 bitrol16โ 16 bit unsigned rotate left by 1 bitror16โ 16 bit unsigned rotate right by 1 bitrol32โ 32 bit unsigned rotate left by 1 bitror32โ 32 bit unsigned rotate right by 1 bitrol64โ 64 bit unsigned rotate left by 1 bitror64โ 64 bit unsigned rotate right by 1 bitrol128โ 128 bit unsigned rotate left by 1 bitror128โ 128 bit unsigned rotate right by 1 bit
--rotate-ops Nโ dip out afterNbogo rotate operations. iconic exit strategy ๐
๐ Restartable sequences (rseq) stressor (Linux)
--rseq Nโ spin upNworkers that literally exercise restartable sequences through therseq(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 aSIGSEGVhandler 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 afterNbogo 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โ startNworkers that go poke at the real time clock (RTC) interfaces via/dev/rtcand/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 afterNbogo RTC interface accesses.
๐๏ธ Scheduler mix stressor
--schedmix Nโ startNworkers, 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 afterNscheduling mixed operations.--schedmix-procs Nโ specify how many child processes to run for each stressor instance, range from1to64, default is16.
๐ Scheduling policy stressor
--schedpolicy Nโ startNworkers that set the worker to various available scheduling policies out ofSCHED_OTHER,SCHED_BATCH,SCHED_IDLE,SCHED_FIFO,SCHED_RR,SCHED_DEADLINEandSCHED_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 afterNbogo 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โ startNworkers 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 isipv4. Currentlyipv4andipv6are supported.--sctp-if NAMEโ use network interfaceNAME. If the interfaceNAMEdoes 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 range16to65535and the default as8192.--sctp-ops Nโ stop sctp workers afterNbogo operations.--sctp-port Pโ start at sctp portP. ForNsctp worker processes, portsPtoP + (N โ 1)are used (wrapped to keep in range of1024to65535). The default port is port50176.--sctp-sched [ fc | fcfs | prio | rr | wfq ]โ specify SCTP scheduler, one offc(fair capacity),fcfs(first come first served, the default),prio(priority),rr(round-robin) orwfq(weighted fair queueing).
๐ง File sealing (SEAL) stressor (Linux)
--seal Nโ startNworkers that exercise thefcntl(2)SEAL commands on a page sized anonymous file created usingmemfd_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 afterNbogo seal operations.
๐ Secure computing stressor
--seccomp Nโ startNworkers that exercise the Secure Computing system call filtering. Each worker creates child processes that write a short message to/dev/nulland then exits. 2% of the child processes have a seccomp filter that disallows thewritesystem call and hence it is killed by seccomp with aSIGSYS. Note that this stressor can generate many audit log messages each time the child is killed. RequiresCAP_SYS_ADMINto run. ๐--seccomp-ops Nโ stop seccomp stress workers afterNseccomp filter tests.
๐คซ Secret memory stressor (Linux โฅ 5.11)
--secretmem Nโ startNworkers thatmmappages using file mapping off amemfd_secret(2)file descriptor. Each stress loop iteration will expand the mappable region by3pages usingftruncateandmmapand 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 afterNstress loop iterations.
๐ File seek stressor
--seek Nโ startNworkers that randomly seeks and performs512byte read/write I/O operations on a file. The default file size is16GB.--seek-ops Nโ stop seek stress workers afterNbogo seek operations.--seek-punchโ punch randomly located8K 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 suffixb,k,morg. pick your fighter โญ
๐ฆ POSIX semaphore stressor
--sem Nโ startNworkers that perform POSIX semaphore wait and post operations. By default, a parent and4children 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 afterNbogo semaphore operations.--sem-procs Nโ startNchild workers per worker to provide contention on the semaphore, the default is4and a maximum of64are 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โ startNworkers that perform System V semaphore wait and post operations. By default, a parent and4children 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 afterNbogo System V semaphore operations.--sem-sysv-procs Nโ startNchild processes per worker to provide contention on the System V semaphore, the default is4and a maximum of64are allowed.--sem-sysv-setallโ sets thesemvalvalues for all the semaphores in the child's semaphore set. This depends on thesemctlSETALLop being defined andGETALLsucceeding and is an opt-in option as it will affect the semaphore being exercised. you've been warned, bestie โ ๏ธ
๐จ Sendfile stressor
--sendfile Nโ startNworkers that send an empty file to/dev/nullusing thesendfile(2)call. This operation spends nearly all the time in the kernel. The default sendfile size is4MB. The sendfile options are for Linux only. ๐ง--sendfile-ops Nโ stop sendfile workers afterNsendfile bogo operations.--sendfile-size Nโ specify the size to be copied with each sendfile call. The default size is4MB. One can specify the size in units of Bytes, KBytes, MBytes and GBytes using the suffixb,k,morg.
๐ Sessions stressor
--session Nโ startNworkers 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 byinit. orphan era, the wayinithas 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 ๐ง
--set Nโ spin up N workers that call syscalls that try to set data in the kernel. The current lineup is:setgid(2),sethostname(2),setpgid(2),setpgrp(2),setuid(2),setgroups(2),setreuid(2),setregid(2),setresuid(2),setresgid(2)andsetrlimit(2). Heads up bestie: some of these are OS specific ๐--set-ops Nโ stop the set workers once N bogo set operations are done, periodt โจ
๐ Shellsort stressor ๐
--shellsort Nโ start N workers that sort 32 bit integers usingshellsort(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 is262144(that's256 ร 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 destroy32shared memory objects, each one8 MBin 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 suffixb,k,morg๐ฆ--shm-mlockโ attempt tomlock(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 destroy8shared memory segments, each8 MBin 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 suffixb,k,morg๐--shm-sysv-mlockโ attempt tomlock(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 is8segments, no cap ๐ซถ
๐ SIGABRT stressor ๐
--sigabrt Nโ start N workers that create children which get killed by SIGABRT signals or by callingabort(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 usingsignalfd(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 usingraise(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 andSIG_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 replacingsignalwith the more modernsigactionsystem 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-voption 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 usessigpending(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 usingclone(2)if it's available, or they use the slowerfork(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 usingsigqueue(3)to child processes waiting for the signal viasigwaitinfo(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 handleSIGRTMINtoSIGRMAXreal time signals. the parent sends each child process an RT signal viasiqueue(2)and the child process waits for it viasigwaitinfo(2). when the child receives the signal it then sends an RT signal to one of the other child processes, also viasigqueue(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 off4child processes which wait for a SIGUSR1 signal from the parent usingsigsuspend(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 usingraise(SIGTRAP). only on x86 Linux systems is the SIGTRAP also generated by anint 3instruction ๐--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 NSIGURGsignals have been handled. โจ
๐ SIGVTARLM stressor ๐
--sigvtalrm Nโ start N workers that exercise theSIGVTALRMsignal using anITIMER_VIRTUALitimer, plus a busy loop that eats CPU time by callinggetitimeron theITIMER_VIRTUALtimer. no cap, it's just vibing on CPU cycles ๐ญ--sigvtalrm-ops Nโ stop the sigvtalrm stress workers after NSIGVTALRMsignals have been handled. slay ๐
๐ฅ SIGXCPU stressor ๐ฅ
--sigxcpu Nโ start N workers that exercise the SIGXCPU stressor. A busy loop generatesSIGXCPUsignals by setting a 0 second run time limit and then following it up with asched_yield(2)call. it's giving "chaos on purpose" ๐--sigxcpu-ops Nโ stop the sigsxcpu stress workers after N bogoSIGXCPUsignal 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 aSIGXFSZsignal. icon behavior honestly ๐ฆ--sigxfsz-ops Nโ stop the sigsxfsz stress workers after N bogoSIGXFSZsignal 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,65536integers 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 from1 Kto4 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 of1usto0.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 is1 microsecondor larger.--sleep-max Pโ start P threads per worker. The default is1024, the maximum allowed is30000. 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 every50 milliseconds), which creates a whole storm of runnable pthreads that execute for a short time before waiting on the next signal. The default of64pthreads 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, range1to30000, with a default of64.--sleepstorm-sleep-ms Nโ sleep for N milliseconds after waking up all the pthreads, range1to1000, with a default of50(e.g.200 Hz).--sleepstorm-yield [ always | never | random ]โ specify the method of callingsched_yield(2)in each pthread. The methods arealways(every time a pthread is woken up),never(never yield), andrandom(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-2system management mode (SMM) by exercising the advanced power management (APM) port0xb2. This requires the--pathologicaloption 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/sndPCM 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 viaselect()andread(). 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 isipv4. Currentlyipv4,ipv6andunixare 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 is1000messages. 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_maxto 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 usingsend(2). This option lets you specify the sending method usingsend(2),sendmsg(2),sendmmsg(2), or a random selection of one of these 3 on each iteration. Note thatsendmmsgis 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, portsPtoP + (N โ 1)are used (wrapped to keep in range of1024to65535). The default port is port50944.--sock-protocol Pโ use the specified protocol P, default istcp. Options aretcpandmptcp(if supported by the operating system).--sock-type [ stream | seqpacket ]โ specify the socket type to use. The default type isstream.seqpacketcurrently only works for theunixsocket domain.--sock-zerocopyโ enable zerocopy forsendandrecvcalls if theMSG_ZEROCOPYis 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, portsPtoP + (N โ 1)are used (wrapped to keep in range of1024to65535). The default port is port51200.
๐ฆ Socket diagnostic stressor (Linux) ๐ฆ
--sockdiag Nโ start N workers that exercise the Linuxsock_diagnetlink socket diagnostics (Linux only). This currently requests diagnostics usingUDIAG_SHOW_NAME,UDIAG_SHOW_VFS,UDIAG_SHOW_PEER,UDIAG_SHOW_ICONS,UDIAG_SHOW_RQLENandUDIAG_SHOW_MEMINFOfor theAF_UNIXfamily of socket connections. all the diagnostics, all at once, no notes ๐--sockdiag-ops Nโ stop after receiving Nsock_diagdiagnostic messages.
๐ Socket file descriptor stressor ๐
--sockfd Nโ start N workers that pass file descriptors over a UNIX domain socket using theCMSG(3)ancillary data mechanism. For each worker, a pair of client/server processes are created; the server opens as many file descriptors on/dev/nullas possible and passes these over the socket to a client that reads these from theCMSGdata 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, portsPtoP + (N โ 1)are used (wrapped to keep in range of1024to65535). The default port is port51456.--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/nulleach time. sustainable queen ๐ฑ
๐ Opening network socket stressor ๐
--sockmany Nโ start N workers that use a client process to attempt to open as many as100000TCP/IP socket connections to a server on port10000. 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 range1to32768and the default as8.--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 is1to65535, and the default is4096. 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_FIOandSCHED_RRscheduling 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 default500 ร 500sparse matrix is used and5000items 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. Theallmethod 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 withcallocand are allocated from a pre-allocated pool, leading to quicker hash table performance than thehashmethod. 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 usingposix_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 of25664 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 is256by default, minimum16to maximum of8388608. 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 slot0and spin waits for the data to appear in memory slot1. The other process spin waits for the data to change in slot0and copies the changed value into memory slot1. 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 default32bit 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 is32bit.128bit and/or atomic read/writes may not be supported by some toolchains. The spinmem methods are as follows:8bitโ 8 bit read/writes16bitโ 16 bit read/writes32bitโ 32 bit read/writes64bitโ 64 bit read/writes128bitโ 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 is1000transactions 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/zeroto/dev/nullthrough a pipe without any copying between kernel address space and user address space usingsplice(2). This is only available for Linux. Zero-copy royalty, honestly. ๐--splice-bytes Nโ transfer N bytes per splice call, the default is64 K. One can specify the size as % of total available memory or in units of Bytes, KBytes, MBytes and GBytes using the suffixb,k,morg.--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 thebrkstressor, 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 tomlock(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 whenmadvise(2)supportsMADV_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 a2 MBstack 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 usingmsync(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,strrchrandstrxfrm. Peepstring(3)if you want the deets on these bad boys.allis the default and it'll run through every single string method, no skips ๐--str-ops Nโ bestie, just dip afterNbogo string operations.
๐ง STREAM memory stressor
--stream Nโ fire upNworkers 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 themmap'd physical pages discontiguous by forcing pages to be inrandomlymixed physical page locations. Chaos, but make it memory ๐--stream-index Nโ sets how many stream indices get used to index into the data arraysa,bandc. 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 suffixb,k,morg. 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 tomlock(2)the stream buffers into memory so they don't get swapped out. Protect the vibes ๐ซถ--stream-madvise [ collapse | hugepage | nohugepage | normal ]โ sets themadvise(2)options used on the memory mapped buffer in the stream stressor. Non-linux systems will only have thenormalmadvise advice. Default isnormalโจ--stream-ops Nโ stop afterNstream 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 0setting.
๐ข String to/from Numeric conversions stressor
--strnum 1โ startNworkers 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 afterNbogo string/numeric conversion operations.--strnum-method methodโ choose the preferred conversion function, bestie. The options are:allโ select all the available conversion methodsatoiโ convert a string to a signed integer usingatoi()atolโ convert a string to a signed long integer usingatol()atollโ convert a string to a signed long long integer usingatoll()strtoulโ convert a string to an unsigned long integer usingstrtoul()strtoullโ convert a string to an unsigned long long integer usingstroull()sscanf-iโ convert a string to a signed integer usingsscanf()sscanf-liโ convert a string to a signed long integer usingsscanf()sscanf-lliโ convert a string to a signed long long integer usingsscanf()sscanf-uโ convert a string to an unsigned integer usingsscanf()sscanf-luโ convert a string to an unsigned long integer usingsscanf()sscanf-lluโ convert a string to an unsigned long long integer usingsscanf()snprintf-iโ convert a signed integer to a string usingsnprintf()snprintf-liโ convert a signed long integer to a string usingsnprintf()snprintf-lliโ convert a signed long long integer to a string usingsnprintf()strtofโ convert a string to a float usingstrtof()strtodโ convert a string to a double usingstrtof()strtoldโ convert a string to a long double usingstrtof()sscanf-fโ convert a string to a float usingsscanf()sscanf-dโ convert a string to a double usingsscanf()sscanf-ldโ convert a string to a long double usingsscanf()strfromfโ convert a float to a string usingstrfromf()strfromdโ convert a double to a string usingstrfromd()strfromlโ convert a long double to a string usingstrfroml()
๐ง Swap partitions stressor (Linux)
--swap Nโ startNworkers 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). RequiresCAP_SYS_ADMINto 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 afterNswapon/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โ startNworkers 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 ofFcontext 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 afterNbogo operations.
๐ Symlink stressor
--symlink Nโ startNworkers creating and removing symbolic links. It's giving file system chaos โจ--symlink-ops Nโ stop symlink stress workers afterNbogo operations.--symlink-syncโ sync dirty data and metadata to disk. Flush it, bestie ๐ฝ๐
๐พ Partial file syncing (sync_file_range) stressor
--sync-file Nโ startNworkers that perform a range of data syncs across a file usingsync_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 theSYNC_FILE_RANGE_WAIT_BEFORE,SYNC_FILE_RANGE_WRITEandSYNC_FILE_RANGE_WAIT_AFTERflag 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 suffixb,k,morg.--sync-file-ops Nโ stop sync-file workers afterNbogo 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 of125msbusy load followed by62.5mssleep, 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-methodmethod โ 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 callsfast10โ select the fastest 10% system call testsfast25โ select the fastest 25% system call testsfast50โ select the fastest 50% system call testsfast75โ select the fastest 75% system call testsfast90โ select the fastest 90% system call testsgeomean1โ select tests that are less or equal to the geometric mean of all the test timesgeomean1โ select tests that are less or equal to 2 ร the geometric mean of all the test timesgeomean1โ 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 thetimes(2)system call. On Linux systems it also reads overall system statistics using thesysinfo(2)system call, plus the file system statistics for all mounted file systems usingstatfs(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/nullwithout any copying between kernel address space and user address space, usingtee(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 of1 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 from1to1000000000Hz (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 0for 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 of1 MHz(Linux only); this can create many thousands of timer clock events. Timer events are waited for on the timer file descriptor usingselect(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 from1to1000000000Hz (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_BOOTTIMEandCLOCK_TAI. For itimers, the following interval timer types are used:ITIMER_REAL,ITIMER_VIRTUALandITIMER_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 exercisesclock_gettime(2)on all available clocks,gettimeofday(2),time(2)andgetrusage(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 of512entries. 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 usingmbind(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--metricsoption. 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 to16child 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-basedmmapoperations on it. Iconic file-system chaos. ๐--tmpfs-mmap-asyncโ turn on file-based memory mapping and use asyncmsync'ing on every page โ peep--tmpfs-mmap-filefor the sibling behavior. โจ--tmpfs-mmap-fileโ turn on tmpfs file-based memory mapping, and by default use synchronousmsync'ing on each page. ๐ฆ--tmpfs-ops Nโ stop the tmpfs stressors after N bogo mmap operations. periodt.
๐ซถ Touching files stressor ๐ซถ
--touch Nโ touch files usingopen(2)orcreat(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 usingopen(2)orcreate(2), justopen(2)with theO_CREATopen flag, or withcreat(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, namelydirect,dsync,excl,noatimeandsyncdirectโ try to minimize cache effects of the I/O to and from this file, using theO_DIRECTopen flag.dsyncโ ensure output has been transferred to underlying hardware and file metadata has been updated, using theO_DSYNCopen 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 theO_SYNCopen 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 (thealloption). 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 exercisesin,cos,sincos(where available) andtanlibm 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 functionscosโ 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 thetscinstruction for x86, themftbinstruction for ppc64, therdcycleinstruction for RISC-V, thetickinstruction on SPARC and therdtime.dinstruction for Loong64. hardware go brrrr. ๐--tsc-lfenceโ addlfenceafter each tsc read to force serialization (x86 only).--tsc-ops Nโ stop the tsc workers after N bogo operations are completed. ๐--tsc-rdtscpโ use therdtscpinstruction instead ofrdtsc(x86 only). This also disables the--tsc-lfenceoption. ๐
๐ธ Binary tree search stressor ๐ธ
--tsearch Nโ start N workers that insert, search and delete 32 bit integers on a binary tree usingtsearch(3),tfind(3)andtdelete(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 isipv4. Currentlyipv4andipv6are 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 foripv4andipv6domains). 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 supportAF_PACKET. ๐--udp-flood-domain Dโ specify the domain to use, default isipv4. Currentlyipv4andipv6are 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 settingumaskand creating/fstat'ing/closing/unlinking a file, plus checking if the file mode is set correctly. This exercises umask mask values from octal0000to0777inclusive. ๐--umask-ops Nโ stop after N rounds of exercising umask values0000to0777. 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 stressor ๐ง
--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 afterNbogo rounds of unlink operations on1024files by the controlling worker. ๐
โจ Unshare stressor (Linux) โจ
--unshare Nโ spin upNworkers, and each one forks off32child processes, and each of those kiddos exercises theunshare(2)system call by disassociating parts of the process execution context. (Linux only ๐ง).--unshare-ops Nโ stop afterNbogo unshare operations.
๐ฆ Uprobe stressor (Linux) ๐ฆ
--uprobe Nโ startNworkers that trace the entry to the libc functiongetpid(2)using the Linux uprobe kernel tracing mechanism. Heads up bestie, this one needsCAP_SYS_ADMINcapabilities and a modern Linux uprobe capable kernel. no cap, it's giving privileged.--uprobe-ops Nโ stop uprobe tracing afterNtrace events of the function that is being traced.
๐ /dev/urandom stressor (Linux) ๐
-u N,--urandom Nโ startNworkers reading/dev/urandom(Linux only). This will load the kernel random number source. chaos energy fr.--urandom-ops Nโ stop urandom stress workers afterNurandom bogo read operations (Linux only).
๐ธ Page faults stressor (Linux) ๐ธ
--userfaultfd Nโ startNworkers that generate write page faults on a small anonymously mapped memory region and handle these faults using the user space fault handling via theuserfaultfd(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โmmapNbytes per userfaultfd worker to page fault on, the default is16 MB. You can specify the size as%of total available memory, or in units of Bytes, KBytes, MBytes and GBytes using the suffixb,k,morg. ๐--userfaultfd-ops Nโ stop userfaultfd stress workers afterNpage faults.
๐ SIGSYS stressor ๐
--usersyscall Nโ startNworkers that exercise the Linuxprctluserspace system call mechanism. A userspace system call is handled by aSIGSYSsignal handler and exercised with the system call disabled (ENOSYS) and enabled (viaSIGSYS) usingprctl PR_SET_SYSCALL_USER_DISPATCH. literally the most unhinged syscall setup and I respect it.--usersyscall-ops Nโ stop afterNsuccessful userspace syscalls via aSIGSYSsignal handler.
โญ File timestamp stressor โญ
--utime Nโ startNworkers 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 afterNutime bogo operations.
๐ Video for Linux version 2 stressor ๐
--v4l2 Nโ startNworkers that exercise various v4l2 ioctl commands on all/dev/videodevices using valid and invalid arguments.--v4l2-ops Nโ stop afterNv4l2 ioctl bogo operations.
๐ง Varying load stressor ๐ง
--varyload Nโ startNworkers that vary the system load using1toNrunnable 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 sendingSIGSTOPandSIGCONTsignals to these processes. ๐--varyload-ops Nโ stop afterNvaryload 1ms bogo cycles--varyload-ms Mโ vary the load everyMmilliseconds (from1to3600000milliseconds). The load is changed based on the--varyload-typeoption.--varyload-sched Pโ select the scheduler policy, may be one ofbatch,deadline,ext,fifo,idle,rrorother.--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 viagetpid(2).inc64โ increment a 64 bit integer.memmoveโ copy (move) a1 MBbuffer usingmemmove(3).memreadโ read from a1 MBbuffer using fast memory reads.memsetโ write to a1 MBbuffer usingmemset(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 pointsqrt(3)andhypot(3)math operations.timeโ get the current time viatime(2).vecfpโ perform multiplication and addition on a vector of64double precision floating point values.vecintโ perform multiplication and addition on a vector of256unsigned 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 for20seconds at a time.brownโ repeatedly vary the load using brown noise, using random increment/decrement in load.triangleโ repeatedly vary the load from1up toNand then down to1in increments of1.saw-incโ repeatedly vary the load from1toNin increments of1and then directly back down to1.saw-decโ repeatedly vary the load fromNdown to1in decrements of1and then directly back up toN.pulseโ repeatedly vary the load directly from1toNand then directly back down to1.randomโ randomly select load in range1..N.
๐ Virtual dynamic shared object stressor ๐
--vdso Nโ startNworkers 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 functionF. The functions depend on the kernel being used, but are typicallyclock_gettime(2),getcpu(2),gettimeofday(2)andtime(2).--vdso-ops Nโ stop afterNvDSO functions calls.
๐ Vector integer comparison operations stressor ๐
--veccmp Nโ startNworkers 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 ร 8bits,8 ร 16bits,4 ร 32bits,2 ร 64bits, and if supported1 ร 128bits. The metrics produced by this mix depend on the processor architecture and the vector math optimisations produced by the compiler. ๐ซถ--veccmp-ops Nโ stop afterNbogo vector integer comparison operations.
๐ Vector floating point operations stressor ๐
--vecfp Nโ startNworkers that exercise floating point (single and double precision) addition, multiplication, division and negation on vectors of128,64,32,16and8floating point values. The-voption 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 valuesfloatv64addโ addition of a vector of 64 single precision floating point valuesfloatv32addโ addition of a vector of 32 single precision floating point valuesfloatv16addโ addition of a vector of 16 single precision floating point valuesfloatv8addโ addition of a vector of 8 single precision floating point valuesfloatv128mulโ multiplication of a vector of 128 single precision floating point valuesfloatv64mulโ multiplication of a vector of 64 single precision floating point valuesfloatv32mulโ multiplication of a vector of 32 single precision floating point valuesfloatv16mulโ multiplication of a vector of 16 single precision floating point valuesfloatv8mulโ multiplication of a vector of 8 single precision floating point valuesfloatv128divโ division of a vector of 128 single precision floating point valuesfloatv64divโ division of a vector of 64 single precision floating point valuesfloatv32divโ division of a vector of 32 single precision floating point valuesfloatv16divโ division of a vector of 16 single precision floating point valuesfloatv8divโ division of a vector of 8 single precision floating point valuesdoublev128addโ addition of a vector of 128 double precision floating point valuesdoublev64addโ addition of a vector of 64 double precision floating point valuesdoublev32addโ addition of a vector of 32 double precision floating point valuesdoublev16addโ addition of a vector of 16 double precision floating point valuesdoublev8addโ addition of a vector of 8 double precision floating point valuesdoublev128mulโ multiplication of a vector of 128 double precision floating point valuesdoublev64mulโ multiplication of a vector of 64 double precision floating point valuesdoublev32mulโ multiplication of a vector of 32 double precision floating point valuesdoublev16mulโ multiplication of a vector of 16 double precision floating point valuesdoublev8mulโ multiplication of a vector of 8 double precision floating point valuesdoublev128divโ division of a vector of 128 double precision floating point valuesdoublev64divโ division of a vector of 64 double precision floating point valuesdoublev32divโ division of a vector of 32 double precision floating point valuesdoublev16divโ division of a vector of 16 double precision floating point valuesdoublev8divโ division of a vector of 8 double precision floating point valuesdoublev128negโ negation of a vector of 128 double precision floating point valuesdoublev64negโ negation of a vector of 64 double precision floating point valuesdoublev32negโ negation of a vector of 32 double precision floating point valuesdoublev16negโ negation of a vector of 16 double precision floating point valuesdoublev8negโ negation of a vector of 8 double precision floating point values
--vecfp-ops Nโ stop afterNvector floating point bogo-operations. bestie, one bogo-op =65536loops of2vector operations โจ so like, one bogo-op on a 16 wide vector is equivalent to65536 ร 2 ร 16floating point operations. the math is mathing ๐
๐งฎ Vector math operations stressor
--vecmath Nโ startNworkers 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 ร 8bits,8 ร 16bits,4 ร 32bits,2 ร 64bits and, where supported,1 ร 128bits ๐ฅ 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 afterNbogo vector integer math operations. ๐ซถ
๐ Shuffled vector math operations stressor
--vecshuf Nโ startNworkers that shuffle data on various 64 byte vectors made up of8,16,32,64and128bit unsigned integers. the integers get shuffled around the vector with4shuffle operations per loop, and65536loops make up one bogo-op of shuffling โจ the data shuffling rates and shuffle operation rates get logged when you use the-voption. 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 methodsu8x64โ shuffle a vector of 64 unsigned 8 bit integersu16x32โ shuffle a vector of 32 unsigned 16 bit integersu32x16โ shuffle a vector of 16 unsigned 32 bit integersu64x8โ shuffle a vector of 8 unsigned 64 bit integersu128x4โ shuffle a vector of 4 unsigned 128 bit integers (when supported)
--vecshuf-ops Nโ stop afterNbogo vector shuffle ops. one bogo-op is equivalent to4 ร 65536vector shuffle operations on 64 bytes of vector data. slay ๐ฆ
๐ Wide vector math operations stressor
--vecwide Nโ startNworkers that perform various 8 bit math operations on vectors of4,8,16,32,64,128,256,512,1024and2048bytes. with the-voption, 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 afterNbogo vector operations (2048iterations of a mix of vector instruction operations). periodt ๐
๐ก๏ธ File based authenticity protection (verity) stressor
--verity Nโ startNworkers that exercise read-only file based authenticity protection using the verity ioctlsFS_IOC_ENABLE_VERITYandFS_IOC_MEASURE_VERITY. this needs file systems with verity support (currentlyext4andf2fson 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 theFS_VERITY_FLbit set on the file flags. very demure, very verified โจ--verity-ops Nโ stop the verity workers afterNfile create, enable verity, check verity and unlink cycles. ๐
๐ด vfork stressor
--vfork Nโ startNworkers continually vforking children that immediately exit. bye bestie ๐--vfork-max Pโ createPprocesses and then wait for them to exit per iteration. the default is just1; 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-maxand--vfork. not me warning you twice ๐ซถ--vfork-ops Nโ stop vfork stress workers afterNbogo operations.
๐ฅ vfork processes as much as possible stressor
--vforkmany Nโ startNworkers 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 afterNvforks have been made.--vforkmany-vmโ enable detrimental performance virtual memory advice usingmadvise(2)on all pages of the vforked process. where possible this will try to set every page in the new process usingmadvise(2)MADV_MERGEABLE,MADV_WILLNEED,MADV_HUGEPAGEandMADV_RANDOMflags. Linux only ๐ง noted.--vforkmany-vm-bytes NโmmapNbytes per vm worker for more memory pressure, the default is64MB. this also enables the--vforkmany-vmoption. one can specify the size as % of total available memory or in units of Bytes, KBytes, MBytes and GBytes using the suffixb,k,morg๐
๐ซง Memory allocate and write stressor
-m N,--vm Nโ startNworkers continuously callingmmap(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โmmapNbytes in total, this is shared by each vm worker, the default is256MB. one can specify the size as % of total available memory or in units of Bytes, KBytes, MBytes and GBytes using the suffixb,k,morgโจ 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. specifying0will 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 mmapMAP_LOCKED(since Linux 2.5.37). this is similar to locking memory as described inmlock(2)๐--vm-madvise adviceโ specifies themadviseadvice option used on the memory mapped regions that the vm stressor uses. non-linux systems will only have thenormalmadvise advice; linux systems supportcollapse,dontneed,hugepage,mergeable,nohugepage,normal,random,sequential,unmergeableandwillneedadvice. if you don't use this option then the default is to pick the random madvise advice for each mmap call. seemadvise(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:- Initialised. the anonymously memory mapped region is set to a known pattern ๐ธ
- 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 ๐ฆ
- 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 in64byte 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 in64byte 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 memory8times, each time just one bit in memory flipped (inverted). this will effectively invert each byte in8passes. ๐ฅ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 to0and flips just1in4096bits to1. it then checks to see if the1s are pulled down to0by their neighbours or if the neighbours have been pulled up to1. ๐galpat-1โ galloping pattern ones. this sets all bits to1and flips just1in4096bits to0. it then checks to see if the0s are pulled up to1by their neighbours or if the neighbours have been pulled down to0. ๐โจgrayโ fill the memory with sequential gray codes (these only change1bit 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 bottom4bits by1and the top4bits by15. nybble rights!! ๐lfsr32โ fill memory with values generated from a32bit Galois linear feedback shift register using the polynomialxโ32 + xโ31 + xโ29 + x + 1. this generates a ring of2โ32 โ 1unique values (all32bit values except for0). literal math icon ๐งmodulo-xโ fill memory over23iterations. each iteration starts one byte further along from the start of the memory and steps along in23byte 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 at64bits at a time with random values, and then check if the memory is set correctly. next, sequentially invert each64bit pattern and again check if the memory is set as expected. ๐mscanโ fill each bit in each byte with1s then check these are set, fill each bit in each byte with0s 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โ iterate8times 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โ iterate8times 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 other7bits. 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 other7bits. 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 in64bit chunks setting bytes in the chunk to the same8bit 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 using32 ร 64bit 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 rotate64bits 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 two32bit 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 in64byte chunks with random patterns. then swap each64chunk 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/reading8bytes of incrementing8bit data. for architectures that support user space cache flushing this will cause high data cache miss rates. ๐จwrite64โ sequentially write to memory using32 ร 64bit 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 themovediriinstruction, 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 supportMAP_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 ofmax_strideto 1 and then read check memory in powers of 2 strides 1 tomax_stride, wheremax_strideis 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โ likedec, 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โ likegray, 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โ likeinc, but with all the relevant address bits inverted.pwr2โ work through memory addresses in steps of powers of two.pwr2invโ likepwr2, but with all the relevant address bits inverted.revโ work through the address range with the bits in the address range reversed.revinvโ likerev, but with all the relevant address bits inverted.--vm-addr-mlockโ attempts tomlock(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 usingprocess_vm_writev(2)andprocess_vm_readv(2). This feature is only supported on Linux. Memory transfers are only verified if the--verifyoption is enabled. ๐ซถ--vm-rw-bytes NโmmapN 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 suffixb,k,morg.--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 aSIGSEGVon return from the unmap. ๐--vm-segv-ops Nโ stops after N bogo vm-segvSIGSEGVfaults.
๐ Vmsplice stressor (Linux) ๐
--vm-splice Nโ moves data from memory to/dev/nullthrough a pipe without any copying between kernel address space and user address space, usingvmsplice(2)andsplice(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 suffixb,k,morg.--vm-splice-ops Nโ stops after N bogo vm-splice operations.
๐ฆ Virtual Memory Area (VMA) stressor ๐ฆ
--vma Nโ starts M workers that create pthreads tommap(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, (x86vpaddb)vpaddb256โ 8 bit vector addition using 256 bit vector operations on 32 ร 8 bit integers, (x86vpaddb)vpaddb128โ 8 bit vector addition using 128 bit vectors operations on 32 ร 8 bit integers, (x86vpaddb)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, (x86vpdpbusd)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, (x86vpdpbusd)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, (x86vpdpbusd)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, (x86vpdpwssd)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, (x86vpdpwssd)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, (x86vpdpwssd)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 apause(2)loop, the other continually stops and continues the first. The controlling process waits on the first child to be resumed by the delivery ofSIGCONTusingwaitpid(2)andwaitid(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,tpauseandumwait(when available) andnop. - For ARM the
yieldinstruction is used. - For PPC64 the
yield,mdoioandmdooominstructions are used. - For RISC-V the
pauseinstruction is used. - For Loong64 the
dbarinstruction is used. - For openRISC the
psyncinstruction is used. - For other architectures no-op instructions are used.
- For x86 these are
--waitcpu-ops Nโ stop after N bogo processor wait operations.
๐ Watchdog stressor ๐
--watchdog Nโ start N workers that exercise the/dev/watchdogwatchdog interface by opening it, perform various watchdog specificioctl(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,wcsrchrandwcsxfrm. Theallmethod 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-threadsoption 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 viagetpid(2).inc64โ increment a 64 bit integer.memmoveโ copy (move) a 1 MB buffer usingmemmove(3).memreadโ read from a 1 MB buffer using fast memory reads.memsetโ write to a 1 MB buffer usingmemset(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 pointsqrt(3)andhypot(3)math operations.timeโ get the current time viatime(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 thatdeadline,fifoandrrrequire 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 iscluster. 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 x86cpuidinstruction with 18 different leaf types. eighteen!! that's so many leaves bestie ๐--x86cpuid-ops Nโ stop after N iterations that exercise the differentcpuidleaf types.
๐ง x86-64 syscall stressor (Linux)
--x86syscall Nโ start N workers that repeatedly exercise the x86-64syscallinstruction to call thegetcpu(2),geteuid(2),getgid(2),getpid(2),gettimeofday(2)andtime(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 ofgetcpu,geteuid,getgid,getpid,gettimeofdayortime.--x86syscall-ops Nโ stop after Nx86syscallsystem 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 callsched_yield(2). This stressor ensures that at least 2 child processes per CPU exerciseshield_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 Nsched_yield(2)bogo operations.--yield-procs Nโ specify the number of child processes to run per stressor instance. The default is2, range1to65536.--yield-sched [ batch | deadline | ext | fifo | idle | other | rr ]โ select scheduling policy. Note thatdeadline,fifoandrrrequire root privilege. ๐ (root energy only, bestie)
๐ /dev/zero stressor
--zero Nโ start N workers that exercise/dev/zerowithread(2),lseek(2),ioctl(2)andmmap(2)calls. For just/dev/zeroread benchmarking use the--zero-readoption.--zero-ops Nโ stop zero stress workers after N/dev/zerobogo read operations.--zero-readโ just read/dev/zerowith 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), where0= no compression,1= fastest compression and9= best compression.--zlib-mem-level Lโ specify the reserved compression state memory for zlib. The default is8.- Value
1โ minimum memory usage. - Value
9โ maximum memory usage.
- Value
--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 distributed0x00and0xFFvalues.ascii01โ randomly distributed ASCII0and1characters.asciidigitsโ randomly distributed ASCII digits in the range of0and9.bcdโ packed binary coded decimals,0..99packed 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 repeated0x04030201.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 polynomialxโ32 + xโ31 + xโ29 + x + 1. This generates a ring of2โ32 โ 1unique values (all 32 bit values except for0).logmapโ Values generated from a logistical map of the equationฮงn+1 = r ร ฮงn ร (1 โ ฮงn)wherer > โผ 3.56994567to 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 fromlrand48(3).morseโ Morse code generated from random latin sentences from a sample of Lorem Ipsum text.nybbleโ randomly distributed bytes in the range of0x00to0x0f.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 range0..255generated 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 single1in every 32 bits, randomly located.rarely0โ data that has a single0in every 32 bits, randomly located.rdrandโ generate random data usingrdrandinstruction (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 is0.- 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).
- Value
--zlib-stream-bytes Sโ specify the amount of bytes to deflate until deflate should finish the block and return withZ_STREAM_END. One can specify the size in units of Bytes, KBytes, MBytes and GBytes using the suffixb,k,morg. The default is0which 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 withZ_STREAM_END.
- Value
--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 is15.
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โ startsNworkers that literally create zombie processes ๐ป it will rapidly try to create a default of8192child 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โ usesclone(2)instead offork(2)to create the zombie processes (Linux only ๐ง). If you run it withCAP_SYS_ADMINthen 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 asNzombie processes. heads up tho: this may not be reached if the system limit is less thanN๐ญ--zombie-ops Nโ stops the zombie stress workers afterNbogo 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 exampleENOMEM(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 byexit(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 ๐ซถ
๐ SPONSOR ๐
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,SIGINTorSIGHUPto 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
SIGUSR2to stress-ng will dump out the current load average and memory statistics. - note that the stress-ng
cpu,io,vmandhddtests 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 ยฉ๏ธ
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
- arch rolling: stress-ng 0.22.02-1 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms