合 Linux下如何快速消耗CPU、内存、IO、磁盘等(压测)
Tags: LinuxOS总结压测stresssysbenchfallocate
CPU
可以参考:https://www.xmmup.com/dbbao66linuxxiaruherangnidecpubaochizai90yishang.html#xiang_guan_wen_zhang
1 2 3 4 5 6 7 8 9 | -- cpu for i in `seq 1 $(cat /proc/cpuinfo |grep "physical id" |wc -l)`; do cat /dev/urandom | md5sum & done for i in `seq 1 $(cat /proc/cpuinfo |grep "physical id" |wc -l)`; do dd if=/dev/zero of=/dev/null & done sysbench --threads=100 --events=80000 cpu --cpu-max-prime=8000000 run stress --cpu 8 --timeout 600 |