- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Extended Memory/CPU Excerise Script ?
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
01-18-2008 03:25 AM
01-18-2008 03:25 AM
Is there a way/script that can excerise memory/CPU continuously ? I know i can excerise using stm but that only gives a good 10min excerise.. I need excerise these memory and CPU continuosly for over night incase it fails over, Then we install it on a production server.
Any kind of help would be grateful
Will
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2008 04:26 PM
01-19-2008 04:26 PM
SolutionYou could do it through many ways, including
primitive but efficient scripts.
For example:
a) A small Shell script:
#!/bin/sh
while true
do
# Test only CPU 1
#
dd if=/dev/rdsk/c0t0d0 of=veryBigFile bs=2048k
mpsched -c 1 gzip veryBigFile
rm -f veryBigFile.gz
done
exit 0
This will run endlessly until script killed.
b) Perl one-liner:
perl -e '$t=shift||60;$SIG{ALRM}=sub {exit};alarm $t;1 while {}'
By default this will run for 60-seconds. Pass
any number of seconds as an argument.
c) Several years ago, another poster
(Ermin Borovac), submitted a small C
program:
#include
int main()
{
int ret;
size_t datsiz = 2147483648;
size_t stsiz = 0;
ret = datalock(datsiz, stsiz);
if (ret == -1) {
perror("datalock");
exit(1);
}
for (;;) {
}
return 0;
}
Compile it with 'cc +DD64'. It should create
a process with 2G data space (of course
adjust this number based on how much memory
you have on your system).
I did not try this C personally.
d) You could even use Linux Test Project
Suite (LTP) and extract various scripts that
suit you for HP-UX:
http://ltp.sourceforge.net/
The LTP has over 3,000 test for Linux :)
e) If you want a vendor-based tool,
and you run HP-UX 11.23 or newer (11.31),
then HP offers it as long as you sign an
ETD Test Tool Non Disclosure Agreement.
Please contact your representative.
HP-UX Meatgrinder is a port of ETD's Linux Meatgrinder test to the HP-UX operating system.
It is available for Itanium and PA-RISC.
Here are some of the test threads:
Ancillary
Audio
Cache
CPU
File System
Flash
Floppy
Interupt
Memory
MultiPCU
Network
PCI Master
Raw Disk
Tape
and more.
I am sure I could come with more ideas, but
I just woke up (Sunday) and need some
coffee to clear my mind :)
Best wishes,
VK2COT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2008 04:58 PM
01-19-2008 04:58 PM
Re: Extended Memory/CPU Excerise Script ?
#!/usr/bin/ksh
while
do
echo "selclass memory;info;wait;excercise" | cstm
done
Here's a link to cstm commands.
http://docs.hp.com/en/diag/stm/sth_cstm.htm#OnCommandsFull
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2008 08:19 PM
01-19-2008 08:19 PM
Re: Extended Memory/CPU Excerise Script ?
Now I feel better after good breakfast and coffee.
Several more ideas:
a) Run continumously:
md5sum < /dev/urandom
/dev/urandom produces an infinite stream of
random data - just pipe that throgh MD5 for
some nice numerical CPU load. Not disk- or network-bound either.
b) To utilize a lot of memory as well as CPU,
you might look for something
like a prime-factoring program.
#!/usr/bin/perl
#
# There are several ways to calculate primes. Probably, the most efficient
# one is recursively dividing a number with all primes lower than the number
# itself. Since no primes are divisible by numbers other than themselves and 1,
# it would be possible to divide a number with all numbers below it. All numbers
# are essentially built up of primes, and therefore we can safely skip dividing
# by numbers which are not primes themselves, speeding up the process significantly.
#
# The array where the primes will be stored
my @primes = (2);
# The maximum number of iterations
my $max = 1000000;
# The starting iteration
my $i = 2;
# Whether the current loop is to be broken
my $b = 1;
# Start the loop
while ($i < $max) {
# Check for each prime which has already been calculated
foreach $n (@primes) {
# If that prime is not divisible by the the current number..
if (!($i % $n)) {
# ..break the loop
$b = 1;
next;
}
}
# If the loop was supposed to be broken,
if ($b) {
reset $b;
$b = 0;
} else {
# add the number to the prime array
push @primes, $i;
print "This is prime number $i\n";
}
# Increment $i
$i++;
}
exit(0);
or even better version that uses Sieve of Eratosthenes:
#!/usr/bin/perl
print "\n=======================\n";
print "PRIME NUMBERS GENERATOR\n";
print "=======================\n";
# Get the range
# Minimum value of primes
my $min = 1;
# Maximum value of primes;
my $max = 10000000;
# Create a max-sized array
my @primes = (1...$max);
# Initially assume all numbers are prime
for($i = 0; $i < $max; $i++) {
$primes[$i] = 1;
}
# The sieve
for ($i=2; $i*$i <= $max;$i+=1) {
if ($primes[$i]) {
for ($j=$i; $j*$i < $max; $j+=1) {
$primes[$i * $j] = 0;
}
}
}
# Show the results
my @p = ();
for ($i=$min; $i<=$max; $i++) {
if ($primes[$i]) {
push @p, $i;
print qq(Found prime $i\n);
}
}
$size = @p;
# print qq(Found $size primes:\n@p\n);
The Perl scripts are not mine. I gathered
them from the Internet sources.
Cheers,
VK2COT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2008 08:26 AM
01-20-2008 08:26 AM
Re: Extended Memory/CPU Excerise Script ?
No need to use other tools - you can easily get the exerciser utility to run for that length of time in stm if you use the right options. This for example will fully exercise CPU and memory for 12 hours (720 minutes):
echo "scl qualifier cpu;scl qualifier memory;eop time 720 maxcoverage;exc;wait;eal;"| cstm
HTH
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2008 01:17 AM
01-21-2008 01:17 AM
Re: Extended Memory/CPU Excerise Script ?
Thanks Michael & Duncan Edmonstone, I would try your pseudo script code aswell