Darren Dunham 15 January 2008 21:57:21 [ permanent link ]
In comp.unix.solaris g f <gfanini@tiscalinet.it> wrote:
I tried to compile a quick one liner program :
main()
{
int i, j;
for (i=0; ; i++)
j++;
}
expecting to see 100% in top, and to my disbelief it stayed at most at
33%
'top' will show you system CPU on Solaris. So it's possible that you only have 3 online CPUs (33% ~ 1CPU), or that other constraints are occuring.
I am not sure on what exact solaris box I am running, I am inside a solaris
10 zone.
Would the zone server allocate only say a quota of total cpu to each zone ?
It's possible, yes.
By being at 33% does it mean there are 3 zones ?
No. Because your process is single threaded, you can't use it to generate more than 1 CPU of load. So the percentage depends on how many CPUs are on the system.
You may need to run more than one copy to saturate multiple CPUs.
perl -e 'while (--$ARGV[0] and fork) {}; while () {}' 4
will give 100% load, but not in my case ?
Where does it say 100% load?
Also, that's not "any old loop". That generates 4 separate processes, each looping. The text mentions that you should adjust the '4' to be the number of CPUs on your system.
Since your process does not fork or create threads, you have to run it multiple times to generate loads for multiple CPUs.
This is earlier on that page...
# a "run away" process or thread usually pegs a single CPU at 100%, however for a multi-CPU server this will be divided by the CPU count - making this error state difficult to identify (eg, spotting a 3% rise for a 32 CPU server).
and futher down...
Technical Details
For a single CPU or virtual CPU (eg, hardware thread): this metric is the percentge of time during the interval that the CPU did not spend in an idle state, such as running the system idle thread. ie, the percentage of time that the CPU ran user and kernel code. This time includes CPU cycles stalled waiting for memory bus requests to main memory.
For a multiple CPUs: the sum of the single CPU percentages, divided by the number of CPUs. A maximum of 100 corresponds to all CPUs at 100 percent utilized for that interval.
-- Darren Dunham ddunham@taos.com Senior Technical Consultant TAOS http://www.taos.com/ Got some Dr Pepper? San Francisco, CA bay area < This line left intentionally blank to confuse you. >