I\'m working on a small function, that gives my users a picture of how occupied the CPU is.
I\'m using cat /proc/loadavg
, which returns the well known 3 num
while true;
do openssl speed;
done
also the stress program will let you load the cpu/mem/disk to the levels you want to simulate:
stress is a deliberately simple workload generator for POSIX systems. It imposes a configurable amount of CPU, memory, I/O, and disk stress on the system. It is written in C, and is free software licensed under the GPLv2.
to maintain a particular level of cpu utilization, say 30%, try cpulimit:
it will adapt to the current system environment and adjust for any other activity on the system.
there's also a patch to the kernel for native cpu rate limits here: http://lwn.net/Articles/185489/