模拟Linux服务器高cpu使用率

原文链接: https://blog.csdn.net/u010416101/article/details/79198402

多核:for i in seq 1 $(cat /proc/cpuinfo |grep "physical id" |wc -l); do dd if=/dev/zero of=/dev/null & done

单核:cat /dev/urandom | gzip -9 > /dev/null
多核:cat /dev/urandom | gzip -9 | gzip -d | gzip -9 | gzip -d > /dev/null
ctrl+c终止

猜你喜欢

转载自blog.csdn.net/tootsy_you/article/details/101541396