- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- simulate high CPU
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2006 06:47 PM
05-23-2006 06:47 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2006 06:59 PM
05-23-2006 06:59 PM
Re: simulate high 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!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2006 07:03 PM
05-23-2006 07:03 PM
Re: simulate high CPU
You don't even need a C prog:
You can run a i/o intensive job:
For instance switch on auditing:
man audsys
start or halt the auditing system and set or display audit
file information
SYNOPSIS
audsys [-nf] [-c file -s cafs] [-x file -z xafs]
or
This script will knock em out !
shell script
#!/bin/sh
$0 &
VAR={ps -ef | grep sh| wc -l)
if [ ${VAR} -eq 100 ]
then
exit 1
else
exec $0
fi
Try first with 100 shells , then slowly
increase.
similare in c.script,
you need to prog the 'if routine' though
main()
{ while(1)
{ fork();
}
}
Keep cooking;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2006 07:04 PM
05-23-2006 07:04 PM
Re: simulate high CPU
Depending upon how many cpus you have run about 20-30 find commands.
find / -name "xynzznn" -exec ll -d {} \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2006 07:32 PM
05-23-2006 07:32 PM
Re: simulate high CPU
You don't even need a C prog:
You can run a i/o intensive job:
For instance switch on auditing:
man audsys
start or halt the auditing system and set or display audit
file information
SYNOPSIS
audsys [-nf] [-c file -s cafs] [-x file -z xafs]
or
This script will knock em out !
shell script
[root@devor:]/root<>>> more knock_em.sh
#!/bin/sh
# shell script to knock em dead
echo $$
VAR=$(ps -ef | grep knock | grep -v grep| wc -l)
if [ ${VAR} -eq 30 ]
then
exit 1
else
print -u1 -- "Running sh number $VAR"
read
$0 &
#exec $0
exit 0
fi
Try first with 30 shells , then slowly
increase depending on your cpu strenght and number.
To stop the script,
Close your telnet session and in an other
session run this:
ps -ef | grep knock | grep -v grep | awk {' print $2 '} | xargs kill -9
The effect is astonishing:
It is idle 5 seconds after starting the script !!!
[root@devor:]/root<>>> sar -u 5 55
HP-UX devor B.10.20 A 9000/861 05/24/06
09:27:57 %usr %sys %wio %idle
09:28:02 30 45 25 0
09:28:07 31 45 24 0
09:28:12 27 51 22 0
09:28:17 29 47 24 0
[root@devor:]/root<>>>
If you insist on a c prog then
this would be the basic idea:
you will need to prog the 'if routine' and
'get out routine' though
main()
{ while(1)
{ fork();
}
}
Keep cooking;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2006 07:36 PM
05-23-2006 07:36 PM
Re: simulate high CPU
hope it was clear that my first posting included typo's.
(A case of serious morning blues)
After my cup of coffee
I tested it for you, hence my second posting.
Enjoy:)))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2006 07:39 PM
05-23-2006 07:39 PM
Re: simulate high CPU
I remember a post in which one of our experts had suggested the very simple method
while true
do
:
done
This will load a whole CPU, you can run more of these if you want to increase the load more and more.
Regards,
Ninad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2006 07:50 PM
05-23-2006 07:50 PM
SolutionHere it is,
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=967140
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2006 08:17 PM
05-23-2006 08:17 PM
Re: simulate high CPU
This thread under my question. Those tool from the lab is the stuff that I am looking for.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2006 08:18 PM
05-23-2006 08:18 PM