系统压力测试工具-stress简介

发表于:2020-11-26 09:49

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:失°疯_失她じ    来源:CSDN

  一、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).

  本文内容不用于商业目的,如涉及知识产权问题,请权利人联系博为峰小编(021-64471599-8017),我们将立即处理
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号