← 返回命令列表

Linux command

stress 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Example

stress -c 4

Example

stress -i 2 -t 5

Example

stress -m 2 --vm-bytes 256M

Example

stress -d 2 --hdd-bytes 1GB

Example

stress -v -c 2

说明

stress imposes a configurable amount of CPU, memory, I/O, or disk stress on a POSIX-compliant operating system and reports any errors it detects. It is useful for evaluating system scalability, performance characteristics, and exposing bugs that manifest under heavy load conditions.

参数

-c, --cpu N
Spawn N workers calculating square roots
-i, --io N
Spawn N workers calling sync()
-m, --vm N
Spawn N workers allocating and freeing memory
--vm-bytes B
Allocate B bytes per vm worker (default: 256MB)
--vm-stride B
Touch bytes at B-byte intervals (default: 4096)
--vm-hang N
Sleep N seconds before freeing memory
--vm-keep
Redirty memory instead of reallocating
-d, --hdd N
Spawn N workers writing and unlinking files
--hdd-bytes B
Write B bytes per hdd worker (default: 1GB)
-t, --timeout N
Terminate after N seconds
--backoff N
Wait N microseconds before starting work
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-error messages
-n, --dry-run
Display actions without executing them

FAQ

What is the stress command used for?

stress imposes a configurable amount of CPU, memory, I/O, or disk stress on a POSIX-compliant operating system and reports any errors it detects. It is useful for evaluating system scalability, performance characteristics, and exposing bugs that manifest under heavy load conditions.

How do I run a basic stress example?

Run `stress -c 4` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -c, --cpu N do in stress?

Spawn N workers calculating square roots