Operating System - HP-UX
1831604 Members
2336 Online
110027 Solutions
New Discussion

script for non-stop looping

 
ust3
Regular Advisor

script for non-stop looping

I would like to test the CPU loading for a new server , I would like to have a script ( eg. for loop ) that non-stop to run a job eg. copy file , create file etc, this is for testing CPU loading , can advise a script ? thx
9 REPLIES 9
Hasan  Atasoy
Honored Contributor

Re: script for non-stop looping

hi ;


while true
do
:
done



Hasan
Torsten.
Acclaimed Contributor

Re: script for non-stop looping

You have a lot of different methods to achieve this, but I guess a copy job only will not effect the CPU load that much.

If you run mstm, select the CPU(s) and run the exercise tool, this will put heavy load on the CPU.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Dennis Handly
Acclaimed Contributor

Re: script for non-stop looping

Ralph Grothe
Honored Contributor

Re: script for non-stop looping

I would think a good way to harness your cpu is to do some number crunching.
Most crypto applications or file packers are good candidates.
You could also try to solve some linear equation systmes as I suppose the notorious lapack is doing.
http://www.netlib.org/lapack/
Madness, thy name is system administration
Ralph Grothe
Honored Contributor

Re: script for non-stop looping

I would think a good way to harness your cpu is to do some number crunching.
Most crypto applications or file packers are good candidates.
You could also try to solve some linear equation systems as I suppose the notorious lapack is doing.
http://www.netlib.org/lapack/
Madness, thy name is system administration
Ralph Grothe
Honored Contributor

Re: script for non-stop looping

I would think a good way to harness your cpu is to do some number crunching.
Most crypto applications or file packers are good candidates.
You could also try to solve some linear equation systems as I suppose the notorious lapack is doing.
http://www.netlib.org/lapack/
Or fluid flow solvers also seem well suited to stress the cpu
http://en.wikipedia.org/wiki/Reynolds-averaged_Navier-Stokes_equations
Madness, thy name is system administration
Ralph Grothe
Honored Contributor

Re: script for non-stop looping

Sorry, for the multi-post.
Webserver didn't respond.
Madness, thy name is system administration
Geoff Wild
Honored Contributor

Re: script for non-stop looping



while true
do
prealloc /someplacewith5gbfree/test.5GB 5368709120
gzip /someplacewith5gbfree/test.5GB
rm /someplacewith5gbfree/test.5GB.gz
done


Something like that...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Tim Nelson
Honored Contributor

Re: script for non-stop looping

As Hasan stated a loop of null will drive the CPU to the roof. Not the most scientific way but I used it to test CPU allocations for wlm.

The below allows you to start as many as you like to drive all CPUs.


#!/usr/bin/ksh

ii=0
COUNT=${1:-2}
if [[ -z $1 ]]
then
echo "Number not supplied, using default of $COUNT"
else
echo "Using supplied number of $1"
fi

while [[ $ii -lt $COUNT ]]
do
while true
do
:
done &
(( ii = ii + 1 ))
done
jobs -l
echo " to terminate"
read pauz
ii=1
while [[ $ii -le $COUNT ]]
do
echo "Killing % $ii "
kill %$ii
(( ii = ii + 1 ))
done