LinuxCommandLibrary

stress

A tool to stress test CPU, memory, and IO on a Linux system.

TLDR

Spawn 4 workers to stress test CPU

$ stress -c [4]
copy


Spawn 2 workers to stress test IO and timeout after 5 seconds
$ stress -i [2] -t [5]
copy


Spawn 2 workers to stress test memory (each worker allocates 256M bytes)
$ stress -m [2] --vm-bytes [256M]
copy


Spawn 2 workers spinning on write()/unlink() (each worker writes 1G bytes)
$ stress -d [2] --hdd-bytes [1GB]
copy

SYNOPSIS

stress [OPTION [ARG]] ...

DESCRIPTION

`stress' imposes certain types of compute stress on your system

-?, --help

show this help statement

--version

show version statement

-v, --verbose

be verbose

-q, --quiet

be quiet

-n, --dry-run

show what would have been done

-t, --timeout N

timeout after N seconds

--backoff N

wait factor of N microseconds before work starts

-c, --cpu N

spawn N workers spinning on sqrt()

-i, --io N

spawn N workers spinning on sync()

-m, --vm N

spawn N workers spinning on malloc()/free()

--vm-bytes B

malloc B bytes per vm worker (default is 256MB)

--vm-stride B

touch a byte every B bytes (default is 4096)

--vm-hang N

sleep N secs before free (default none, 0 is inf)

--vm-keep

redirty memory instead of freeing and reallocating

-d, --hdd N

spawn N workers spinning on write()/unlink()

--hdd-bytes B

write B bytes per hdd worker (default is 1GB)

Example: stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 10s

Note: Numbers may be suffixed with s,m,h,d,y (time) or B,K,M,G (size).

SEE ALSO

The full documentation for stress is maintained as a Texinfo manual. If the info and stress programs are properly installed at your site, the command info stress should give you access to the complete manual.

Copied to clipboard