#
# memory class stressors:
#   various options have been commented out, one can remove the
#   proceeding comment to enable these options if required.

#
# run the following tests in parallel or sequentially
#
run sequential
# run parallel

#
# aggressive:
#   enables more file, cache and memory aggressive options. This may
#   slow tests down, increase latencies and  reduce  the  number  of
#   bogo  ops as well as changing the balance of user time vs system
#   time used depending on the type of stressor being used.
#
# aggressive

#
# ignite-cpu:
#   alter kernel controls to try and maximize the CPU. This requires
#   root  privilege  to alter various /sys interface controls.  Cur‐
#   rently this only works for Intel P-State enabled x86 systems  on
#   Linux.
#
# ignite-cpu

#
# keep-name:
#   by  default,  stress-ng  will  attempt to change the name of the
#   stress processes according to their functionality;  this  option
#   disables  this and keeps the process names to be the name of the
#   parent process, that is, stress-ng.
#
# keep-name

#
# metrics-brief:
#   enable metrics and only output metrics that are non-zero.
#
metrics-brief

#
# verbose
#   show all debug, warnings and normal information output.
#
verbose

#
# run each of the tests for 60 seconds
#  stop stress test after N seconds. One can also specify the units
#  of time in seconds, minutes, hours, days or years with the  suf‐
#  fix s, m, h, d or y.
#
timeout 60s

#
# per stressor options start here
#

#
# atomic stressor options:
#   start  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. This stressor is only available for builds
#   using GCC 4.7.4 or higher. The stressor forces  many  front  end
#   cache stalls and cache references.
#
atomic 0		# 0 means 1 stressor per CPU
# atomic-ops 1000000	# stop after 1000000 bogo ops

#
# bsearch stressor options:
#   start  N  workers  that  binary  search a sorted array of 32 bit
#   integers using bsearch(3). By default, there are 65536  elements
#   in the array.  This is a useful method to exercise random access
#   of memory and processor cache.
#
bsearch 0		# 0 means 1 stressor per CPU
# bsearch-ops 1000000	# stop after 1000000 bogo ops
# bsearch-size 65536	# number of elements to bsearch on

#
# context stressor options:
#   start N workers that run three threads that  use  swapcontext(3)
#   to  implement the thread-to-thread context switching. This exer‐
#   cises rapid process context saving and restoring  and  is  band‐
#   width limited by register and memory save and restore rates.
#
context 0		# 0 means 1 stressor per CPU
# context-ops 1000000	# stop after 1000000 bogo ops

#
# full stressor options:
#   start N workers that exercise /dev/full.  This attempts to write
#   to  the  device  (which should always get error ENOSPC), to read
#   from the device (which should always return a buffer  of  zeros)
#   and  to  seek  randomly  on the device (which should always suc‐
#   ceed).  (Linux only).
#
full 0			# 0 means 1 stressor per CPU
# full-ops 1000000	# stop after 1000000 bogo ops

#
# heapsort stressor options:
#   start  N  workers  that sort 32 bit integers using the BSD heap‐
#   sort.
#
heapsort 0		# 0 means 1 stressor per CPU
# heapsort-ops 1000000	# stop after 1000000 bogo ops

#
# hsearch stressor options:
#   start  N  workers  that  search  a  80%  full  hash  table using
#   hsearch(3). By default, there are 8192  elements  inserted  into
#   the  hash  table.  This is a useful method to exercise access of
#   memory and processor cache.
#
hsearch 0		# 0 means 1 stressor per CPU
# hsearch-ops 1000000	# stop after 1000000 bogo ops
# hsearch-size 8192	# number of hash entries to search on

#
# lockbus stressor options:
#   start N workers that rapidly lock and increment 64 bytes of ran‐
#   domly chosen memory from a 16MB mmap'd region  (Intel  x86  CPUs
#   only).  This will cause cacheline misses and stalling of CPUs.
#
lockbus 0		# 0 means 1 stressor per CPU
# lockbus-ops 1000000	# stop after 1000000 bogo ops

#
# lsearch stressor options:
#   start N workers that linear search a unsorted array  of  32  bit
#   integers  using  lsearch(3). By default, there are 8192 elements
#   in the array.  This is a useful method  to  exercise  sequential
#   access of memory and processor cache.
#
lsearch 0		# 0 means 1 stressor per CPU
# lsearch-ops 1000000	# stop after 1000000 bogo ops
# lsearch-size 8192	# number of elements to lsearch on

#
# malloc stressor options:
#   start N workers continuously calling malloc(3), calloc(3), real‐
#   loc(3)  and  free(3). By default, up to 65536 allocations can be
#   active at any point, but this can be  altered  with  the  --mal‐
#   loc-max option.  Allocation, reallocation and freeing are chosen
#   at random; 50% of the time memory  is  allocation  (via  malloc,
#   calloc  or  realloc) and 50% of the time allocations are free'd.
#   Allocation sizes are also random, with  the  maximum  allocation
#   size  controlled  by the --malloc-bytes option, the default size
#   being 64K.  The worker is re-started if it is killed by the  out
#   of memory (OOM) killer.
#
malloc 0		# 0 means 1 stressor per CPU
# malloc-bytes 64K	# maximum allocation chunk size
# malloc-max 65536	# maximum number of allocations of chunks
# malloc-ops 1000000	# stop after 1000000 bogo ops
# malloc-thresh 1M	# use mmap when allocation exceeds this size

#
# matrix stressor options:
#   start N workers that perform various matrix operations on float‐
#   ing  point values. By default, this will exercise all the matrix
#   stress methods one by one.  One can specify  a  specific  matrix
#   stress method with the --matrix-method option.
#
matrix 0		# 0 means 1 stressor per CPU
# matrix-ops 1000000	# stop after 1000000 bogo ops
# matrix-method all	# use all matrix stressor methods
# matrix size 65536	# size of N x N matrix

#
# membarrier stressor options:
#   start  N workers that exercise the membarrier system call (Linux
#   only).
#
membarrier 0		# 0 means 1 stressor per CPU
# membarrier-ops 1000000 # stop after 1000000 bogo ops

#
# memcpy stressor options:
#   start  N workers that copy 2MB of data from a shared region to a
#   buffer using memcpy(3) and then move the data in the buffer with
#   memmove(3)  with 3 different alignments. This will exercise pro‐
#   cessor cache and system memory.
#
memcpy 0		# 0 means 1 stressor per CPU
# memcpy-ops 1000000	# stop after 1000000 bogo ops

#
# memfd stressor options:
#   start N workers that create  allocations  of  1024  pages  using
#   memfd_create(2)  and  ftruncate(2) for allocation and mmap(2) to
#   map the allocation  into  the  process  address  space.   (Linux
#   only).
#
memfd 0			# 0 means 1 stressor per CPU
# memfd-ops 1000000	# stop after 1000000 bogo ops
# memfd-bytes 256M	# size of memfd allocations
# memfd-fds 256		# number of memfds to have open

#
# memthrash stressor options:
#   start N workers that thrash and exercise a 16MB buffer in  vari‐
#   ous ways to try and trip thermal overrun.
#
memthrash 0		# 0 means 1 stressor per CPU
# memthrash-ops 1000000 # stop after 1000000 bogo ops
# memthrash-method all  # all all memthrash methods, one can use:
			# all, chunk1, chunk8, chunk64, chunk256
			# chunkpage, flip, flush, lock, matrix,
			# memset, mfence, prefetch, random,
			# spinread or spinwrite

#
# mergesort stressor options:
#   start  N  workers that sort 32 bit integers using the BSD merge‐
#   sort.
#
mergesort 0		# 0 means 1 stressor per CPU
# mergesort-ops 1000000 # stop after 1000000 bogo ops
# mergesort-size 262144 # number of elements to mergesort
#

#
# mincore stressor options:
#   start N workers that walk through all of memory 1 page at a time
#   checking of the page mapped and also is resident in memory using
#   mincore(2).
#
mincore 0		# 0 means 1 stressor per CPU
# mincore-ops 1000000	# stop after 1000000 bogo ops
# mincore-random	# select pages randomly rather than sequentially

#
# null stressor options:
#   start N workers writing to /dev/null
#
null 0			# 0 means 1 stressor per CPU
# null-ops 1000000	# stop after 1000000 bogo ops

#
# numa stressor options:
#   start N workers that migrate stressors and a 4MB  memory  mapped
#   buffer   around   all  the  available  NUMA  nodes.   This  uses
#   migrate_pages(2)  to  move  the  stressors  and   mbind(2)   and
#   move_pages(2) to move the pages of the mapped buffer. After each
#   move, the buffer is written to force activity over the bus which
#   results  cache misses.  This test will only run on hardware with
#   NUMA enabled and more than 1 NUMA node.
#
numa 0			# 0 means 1 stressor per CPU
# numa-ops 1000000	# stop after 1000000 bogo ops

#
# oom-pipe stressor options:
#   start N workers that create as many pipes as allowed  and  exer‐
#   cise  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 the --aggressive
#   mode enabled the data is not read out when the pipes are shrunk,
#   causing  the kernel to OOM processes aggressively.  Running many
#   instances of this stressor will force kernel  to  OOM  processes
#   due to the many large pipe buffer allocations.
#
oom-pipe 0		# 0 means 1 stressor per CPU
# oom-pipe-ops 1000000	# stop after 1000000 bogo ops

#
# pipe stressor options:
#   start  N  workers  that  perform  large pipe writes and reads to
#   exercise pipe I/O.  This exercises memory  write  and  reads  as
#   well  as  context  switching.   Each worker has two processes, a
#   reader and a writer.
#
pipe 0			# 0 means 1 stressor per CPU
# pipe-ops 1000000	# stop after 1000000 bogo ops
# pipe-data-size 4K	# pipe data transfer size
# pipe-size 512		# pipe size

#
# qsort stressor options:
#   start N workers that sort 32 bit integers using qsort.
#
qsort 0			# 0 means 1 stressor per CPU
# qsort-ops 1000000	# stop after 1000000 bogo ops
# qsort-size 262144	# number of elements to qsort

#
# remap stressor options:
#   start N workers that map 512  pages  and  re-order  these  pages
#   using  the  deprecated  system call remap_file_pages(2). Several
#   page re-orderings are exercised: forward,  reverse,  random  and
#   many pages to 1 page.
#
remap 0			# 0 means 1 stressor per CPU
# remap-ops 1000000	# stop after 1000000 bogo ops

#
# resources stressor options:
#   start  N  workers  that  consume  various system resources. Each
#   worker will spawn 1024 child processes that iterate  1024  times
#   consuming  shared memory, heap, stack, temporary files and vari‐
#   ous file descriptors (eventfds, memoryfds,  userfaultfds,  pipes
#   and sockets).
#
resources 0		# 0 means 1 stressor per CPU
# resources-ops 1000000	# stop after 1000000 bogo ops

#
# rmap stressor options:
#   start  N workers that exercise the VM reverse-mapping. This cre‐
#   ates 16 processes per  worker  that  write/read  multiple  file-
#   backed  memory  mappings.  There  are 64 lots of 4 page mappings
#   made onto the file, with each mapping overlapping  the  previous
#   by 3 pages and at least 1 page of non-mapped memory between each
#   of the mappings. Data is synchronously msync'd to the file 1  in
#   every 256 iterations in a random manner.
#
rmap 0			# 0 means 1 stressor per CPU
# rmap-ops 1000000	# stop after 1000000 bogo ops

#
# stack stressor options:
#   start N workers that rapidly cause and catch stack overflows  by
#   use of alloca(3).
#
stack 0			# 0 means 1 stressor per CPU
# stack-ops 1000000	# stop after 1000000 bogo ops
# stack-fill		# zero stack to force pages in

#
# stackmmap stressor options:
#   start N workers that use a 2MB stack that is memory mapped  onto
#   a  temporary file. A recursive function works down the stack and
#   flushes dirty stack pages back to the memory mapped  file  using
#   msync(2) until the end of the stack is reached (stack overflow).
#   This exercises dirty page and stack exception handling.
#
stackmmap 0		# 0 means 1 stressor per CPU
# stackmmap-ops 1000000 # stop after 1000000 bogo ops

#
# str stressor options:
#   start N workers that exercise various libc string  functions  on
#   random strings.
#
str 0			# 0 means 1 stressor per CPU
# str-ops 1000000	# stop after 1000000 bogo ops
# str-method all	# select all string methods

#
# stream stressor options:
#   start N workers exercising a memory bandwidth  stressor  loosely
#   based  on  the STREAM "Sustainable Memory Bandwidth in High Per‐
#   formance Computers" benchmarking tool by John D. McCalpin, Ph.D.
#   This  stressor  allocates  buffers that are at least 4 times the
#   size  of the  CPU L2 cache and  continually  performs  rounds of
#   computations on large  arrays of double precision floating point
#   numbers.
#
stream 0		# 0 means 1 stressor per CPU
# stream-ops 1000000	# stop after 1000000 bogo ops
# stream-l3-size 4M	# CPU level 3 cache size

#
# tlb-shootdown stressor options:
#   start  N  workers  that force Translation Lookaside Buffer (TLB)
#   shootdowns.  This is achieved by creating up to  16  child  pro‐
#   cesses 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.
#
tlb-shootdown 0		# 0 means 1 stressor per CPU
tlb-shootdown-ops 1000000 # stop after 1000000 bogo ops

#
# tmpfs stressor options:
#   start N workers that create a temporary  file  on  an  available
#   tmpfs file system and perform various file based mmap operations
#   upon it.
#
tmpfs 0			# 0 means 1 stressor per CPU
# tmpfs-ops 1000000	# stop after 1000000 bogo ops

#
# tsearch stressor options:
#   start N workers that insert, search and delete 32  bit  integers
#   on  a  binary tree using tsearch(3), tfind(3) and tdelete(3). By
#   default, there are 65536 randomized integers used in  the  tree.
#   This  is a useful method to exercise random access of memory and
#   processor cache.
#
tsearch 0		# 0 means 1 stressor per CPU
# tsearch-ops 1000000	# stop after 1000000 bogo ops
# tsearch-size 65536	# number of elements to tsearch on

#
# vm stressor options:
#   start N workers continuously calling mmap(2)/munmap(2) and writ‐
#   ing to the allocated memory. Note that this can cause systems to
#   trip the kernel OOM killer on Linux systems if not enough physi‐
#   cal memory and swap is not available.
#
vm 0			# 0 means 1 stressor per CPU
# vm-ops 1000000	# stop after 1000000 bogo ops
# vm-bytes 256M		# size of each vm mmapping
# vm-hang 0		# sleep 0 seconds before unmapping
# vm-keep		# don't keep unmapping and remapping
# vm-locked		# lock pages into memory using MAP_LOCKED
# vm-method all		# vm data exercising method; use all types
# vm-populate		# populate (prefault) pages into memory

#
# vm-rw stressor options:
#   start N workers that  transfer  memory  to/from  a  parent/child
#   using process_vm_writev(2) and process_vm_readv(2). This is fea‐
#   ture is only supported on Linux.  Memory transfers are only ver‐
#   ified if the --verify option is enabled.
#
vm-rw 0			# 0 means 1 stressor per CPU
# vm-rw-ops 1000000	# stop after 1000000 bogo ops
# vm-rw-bytes 16M	# size of each mmap'd region per stressor

#
# wcs stressor options:
#   start N workers that exercise various libc wide character string
#   functions on random strings.
#
wcs 0			# 0 means 1 stressor per CPU
# wcs-ops 1000000	# stop after 1000000 bogo ops
# wcs-method all	# use all wide string functions

#
# zero stressor option:
#   start N workers reading /dev/zero
#
zero 0			# 0 means 1 stressor per CPU
zero-ops 1000000	# stop after 1000000 bogo ops

#
# zlib stressor option:
#   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.
#
zlib 0			# 0 means 1 stressor per CPU
# zlib-ops 1000000	# stop after 1000000 bogo ops
# zlib-method random	# randomly select data generation methods

