Linux环境:Debian,Ubuntu,Centos
目标:
测试监控程序,设置警报并以不同的cpu百分比触发不同的警报.
例如:(30-50%),(51-70%)和> 90%
所以我需要一个可以模拟每个核心特定cpu百分比的cpu stresser.
压力-mg看起来像最先进的.
根据其文档http://kernel.ubuntu.com/~cking/stress-ng/,可以将负载值设置在0到100%之间:
-l P –cpu-load P load cpu by P %,0=sleep,100=full load (see -c)
stress-ng -c 1 -p 30
stress-ng: info: [12650] dispatching hogs: 0
I/O-Sync,1 cpu,0 VM-mmap,0 HDD-Write,0 Fork,0 Context-switch,30
Pipe,0 Cache,0 Socket,0 Yield,0 Fallocate,0 Flock,0 Affinity,0
Timer,0 Dentry,0 Urandom,0 Float,0 Int,0 Semaphore,0 Open,0
SigQueue,0 Poll
不理想的结果:
但它似乎不起作用,aLL核心在100%徘徊
任何想法如何实现这一目标?