Linux environment: Debian, Ubuntu, Centos
Goal:
Test monitoring program that set alarms and trigger different alarms at different cpu percentages.
ex: (30-50%), (51-70%) and >90%
So I need a cpu stresser that can simulate specific cpu percentage per core.
stress-mg looks like the most advanced.
According to its documentation http://kernel.ubuntu.com/~cking/stress-ng/ it is possible to set load values between 0 and 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
Undesired result:
But it doesn't seem to work, aLL cores are hogged at 100%
Any ideas how to achieve this?