0

I would like to measure latencies during high cpu usage but I don't have benchmarking tools like stress and I can't install them.

Which operations do you recommend to put the cpu under intense load? I would like to reach 100% of cpu usage (I have 700Mhz) without freezing the system. So please don't suggest commands like the fork bomb.

  • 1
    Does this help? – devnull Feb 18 '15 at 19:02
  • I don't have stress installed and I can't run make... – UserK Feb 18 '15 at 19:05
  • 1
    Wow actually yes. The guy suggests cat /dev/zero > /dev/null -> 100% of cpu usage. Love this useless command! @ DevNull, your name appears in the command – UserK Feb 18 '15 at 19:08
  • Try cat /dev/zero. – jimmij Feb 18 '15 at 19:10
  • @jimmij with your command I get only 60% – UserK Feb 18 '15 at 19:12
1

For each core:

dd if=/dev/zero of=/dev/null

or:

while :; do :; done
3

I suggest looking at this thread for some answers.

One approach like you found is:

cat /dev/zero > /dev/null
[OR]
cat /dev/random > /dev/null
1

Compressing video always does it for me, especially since ffmpeg allows you to specify threads.

Something like this (warning, this is an intentional infinite loop):

while [ yes ] ; do ffmpeg -i samplevideo.mp4 -vcodec libtheora -an -b:v 25000 -g 1 -threads 24 -y output.mkv ; done

You could also calculate primes. It starts out simple but in the higher range, it'll get yer CPU churning.


#include                                                            

int main(void)                                                               
{                                                                            
int i,n,q;                                                                   

for(i=2;i>0;i++) {                                                           
    q=0;                                                                     
    for(n=1;n

Compile that with gcc:

gcc primes.c -o primes

And run it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.