Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: OT: Pin a CPU in Solaris

Re: OT: Pin a CPU in Solaris

From: Jared Still <jkstill_at_cybcon.com>
Date: Tue, 12 Jun 2001 22:58:18 -0700
Message-ID: <F001.00326FD7.20010612230521@fatcity.com>

On Tuesday 12 June 2001 10:40, Erik Williams wrote:
> Does anyone know how to pin a Solaris CPU at a high utilization? I am doing
> some testing and want to evaluate a system under a high CPU load. Thanks.
>
> Erik

The philosophical context of this excercise is already well covered, so I just had some fun making a Perl script to do it.

Run it in a loop, add a loop to the script, run as many of these as you want.

Fire up 50 of these babies simultaneously and bring your system administrator to his knees, along with your systems.

Change the factorial from 2,000,000 to 200,000,000 for extra special effects. ;)

You're welcome. :)

Jared



#!/usr/bin/perl -w

print factorial([1..2000000]), "\n";

sub factorial {

        $refArray2Factor = shift;
        clear();
        my $factored=0;
        my $arrayMax = @$refArray2Factor;

        for ( my $i=0; $i<$arrayMax; $i++ ) {
                $factored = _factorial(${$refArray2Factor}[$i]);
        }

        return $factored;

}

{

my $factorial;

sub _factorial {

        my $factor = shift;
        $factorial = 1 unless defined $factorial;
        $factorial *= $factor;
        return $factorial;

}

sub clear { undef $factorial }

}

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Jared Still
  INET: jkstill_at_cybcon.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Jun 13 2001 - 00:58:18 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US