一、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),我们将立即处理