Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Operating System - Tru64 Unix
cancel
Showing results for 
Search instead for 
Did you mean: 

CPU overload tool for Tru64

Aco Blazeski
Regular Advisor

CPU overload tool for Tru64

Hi to all,

Is there any tool/command for loading CPUs in Tru64. I need that for testing purposes. I know that for solaris for example there is "nspin".
If anyone knows something similar for tru64 I would appreciate your time and comments :)

regards
6 REPLIES
Ivan Ferreira
Honored Contributor

Re: CPU overload tool for Tru64

You can use the "yes" command.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Hein van den Heuvel
Honored Contributor

Re: CPU overload tool for Tru64

I tend to use a trivial AWK or PERL one liner:

perl -e 'while (1+1==2){}'
or
perl -e '$i++ while (1);'
or
perl -e 'for (1..9999999){}'


Hein.
Aco Blazeski
Regular Advisor

Re: CPU overload tool for Tru64

Ivan, Heuvel thanks for your response.
These suggestions will do some of the job
But still, if there is any tool that can make a CPU load in more controlled way will be quite helpful for me.
For example if I have 6 CPUs, I want CPU 0 and CPU 1 to push to 100% load ...

Regards,
Ivan Ferreira
Honored Contributor

Re: CPU overload tool for Tru64

Use the runon command with the examples previously given.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Hein van den Heuvel
Honored Contributor

Re: CPU overload tool for Tru64

So you start a few?

perl -e 'for (1..9999999) {}' &
perl -e 'for (1..9999999) {}' &

Or you get more fancy in the perl and fork a controlled number of sub processes, waiting for them to finish at the end:

perl -e 'for (1..3) {if (!fork()){ for (1..999999){}}}; $x++ while (-1 != wait())"

Next step is probably to replace the
'for (1..9999999)'
with

'for (1..99) {for (1..99999){}; sleep(1)}}'

That is, alternate spinning with sleep, a number of times.

In the block/fork might be more realistic to do an exec of a task which is known to cause a given load and still a more or less realistic common task like some 'grep'.

If you think you need anything more fancy, then study up, or leave it to the experts!
IMHO, if you don't know how to cause/describe the load, then you are not likely to know how to correctly use the result either.

Cheers,
Hein van den Heuvel
HvdH Performance Consulting.

Aco Blazeski
Regular Advisor

Re: CPU overload tool for Tru64

Thanks people,

runon CPU_NUM "perl -e 'while (1+1==2){}'"

definitely freaks out the CPU which was my goal.

In case you didn't see it, maybe you can help me on this one:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1093218

Thanks a lot again,
Regards