undefined

stress 压力测试工具

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
[root@localhost ~]# stress 
`stress' imposes certain types of compute stress on your system

Usage: stress [OPTION [ARG]] ...
-?, --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).
  • -t, –timeout N 指定运行N秒后结束
    • –backoff N 等待N微妙后开始运行
  • -c, –cpu N 产生 N 个进程都反复计算随机数的平方根
  • -i, –io N 产生 N 个进程,每个进程反复调用 sync(),sync() 用于将内存上的内容写到硬盘上
  • -m, –vm N 产生 N 个进程,每个进程不断调用内存分配 malloc 和 内存释放 free 函数
    • –vm-bytes B 指定每次 malloc 内存字节数(默认为 256M)
    • –vm-hang N 指定 free 之前等待 N 秒
  • -d, –hdd N 产生 N 个执行 write/unlink 的进程
    • -hdd-bytes B 指定每次写的字节数(默认为1G)