ubuntu系统压力测试工具--stress

一、Stress是什么

stress是一个linux下的压力测试工具,专门为那些想要测试自己的系统,完全高负荷和监督这些设备运行的用户。

二、安装

[root@ubuntu~]#apt-get install stress #直接安装
[root@ubuntu~]#stress --version #查看版本
stress 1.0.4

 三、使用方法

[root@ubuntu~] #stress --cpu 24 --vm 4 --vm-bytes 100G --timeout 100s
[root@ubuntu~] #stress -c 1 -t 100 #测试一个cpu负载
[root@ubuntu~] #stress  --io 100 -t 100 # 测试读写速度
[root@ubuntu~] #stress --vm 10 --vm-bytes 100G --vm-hang 100 --timeout 100s #测试内存,可自定义
[root@ubuntu~] #stress --hdd 1 --hdd-bytes 1024G #测试磁盘I/O默认写入大小为1G 

#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 显示版本号
 -v, --verbose      be verbose
#-q 不显示运行信息
 -q, --quiet        be quiet
#-n 显示已完成的指令情况
 -n, --dry-run      show what would have been done
#-t --timeout N 指定运行N秒后停止
#--backoff N 等待N微妙后开始运行
 -t, --timeout N    timeout after N seconds
     --backoff N    wait factor of N microseconds before work starts
#-c 产生n个进程 每个进程都反复不停的计算随机数的平方根
 -c, --cpu N        spawn N workers spinning on sqrt()
#-i 产生n个进程 每个进程反复调用sync(),sync()用于将内存上的内容写到硬盘上
 -i, --io N         spawn N workers spinning on sync()
#-m --vm n 产生n个进程,每个进程不断调用内存分配malloc和内存释放free函数
#--vm-bytes B 指定malloc时内存的字节数 (默认256MB)
#--vm-hang N 指定在free钱的秒数
 -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 --hadd n 产生n个执行write和unlink函数的进程
#-hadd-bytes B 指定写的字节数
#--hadd-noclean 不unlink
 -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

#时间单位可以为秒s,分m,小时h,天d,年y,文件大小单位可以为K,M,G
Note: Numbers may be suffixed with s,m,h,d,y (time) or B,K,M,G (size).

 

  • 0
    点赞
  • 41
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值