This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
X-MIME-Autoconverted: from 8bit to quoted-printable by mail-relay1.yahoo.com id 
j5PEaRMS057260

Sorry for using less than precise wording in my previous letter. To make
amends, I quote from the top manual page for the interactive  '1' (one)
command,

       ´1´ :Toggle_Single/Separate_Cpu_States  --  On/Off
              This  command  affects how the 't' command's Cpu States
portion
              is shown.  Although this toggle exists primarily to serve
mas-
              sively-parallel  SMP  machines,  it is not restricted to
solely
              SMP environments.

              When you see 'Cpu(s):' in the summary area, the '1'
toggle  is
              On  and all cpu information is gathered in a single line.
Oth-
              erwise, each cpu is displayed separately as: 'Cpu0, Cpu1,  ...

The trick in looking at the output from above is to realize that for CPU
pairs (not sure which ones, but one would hope it is 0/1 and 2/3)  the
percentages reported for us, sy and ni will add, to at most, 100%.  (The
other trick is not to pay attention to the reported numbers for id and
wa when calculating total CPU utiltztion.)

As for vmstat, we can remove the myth from the math by thinking about
how the average CPU utilization is calculated. The data for the
calculation is read from /proc/stat, which has a separate line for each
real/virtual cpu. My guess for the vmstat algorithm is to read each
line, add the numbers together and then divide by the total number of
CPU's. Since an HT system reports four cpus but only has two execution
units, the real average is cut in half (divided by four instead of two.)
So the us and sy times should be multiplied by two to get a clear
reading. For the computer whose problems started this thread, that would
give a system average cpu utilization of 40%. This still looks like a
low enough number that it can support double the number of servers at
80% CPU utilization.

So, there is no need to turn HT off to get better statistics, one just
needs to understand what is going on. (Which, I have to admit, I didn't
when this thread started.) As for the turning HT off to make
multitasking OS's run faster, the argument I have seen so far "since the
SMP will now only need to have to know about 2 instead of 4 CPU's" is
poorly informed. HT reduces the amount of overhead associated with a
context switch.On a system with multiple active processes, this more
than makes up for the additional OS overhead of tracking 2 additional
CPU's. Don't take my word for it, run a benchmark and see for yourself.

Sid




Clayton Macleod wrote:

>actually, top's "load average" has very little to do with CPU usage.
>All it tells you is how many processes were competing for / using *any
>amount* of CPU in a given time period. It doesn't tell you what
>percentage of CPU is being used, you can have a load average in the
>5.x range and still have the CPU sitting idle 80% of the time. Load
>average does help you guage performance, but it's only one factor of
>many that tell you how the box is actually performing and whether or
>not it is underpowered for the tasks it is doing. If the first of the
>three load average numbers is 5.2, for argument's sake, all that tells
>you is that in the last minute there was an average of 5.2 processes
>each using *some* CPU time at once. Again, it does not tell you how
>much CPU was actually used. It only tells you how many processes were
>competing for CPU. Some/all of them could be using next to no CPU, or
>some/all of them could be eating as much as they possibly could. You
>can't tell that from the load average values.
>
>And I'm afraid everyone here that has said HT skews the CPU usage
>tracking are entirely correct, you can't accurately tell how much CPU
>is actually being used and how much is actually free/idle when you
>have HT turned on. It's just a fact of HT life. It doesn't relate at
>all to a true dual CPU machine when it comes to measuring how much CPU
>is being used and how much is idle, because it's difficult to actually
>measure when you're only using tricks to emulate dual CPUs. HT
>definitely helps out *some* in a multi-threaded/multi-tasking
>environment, but its very nature means you can't really tell how much
>it will help out. Nor can you easily measure exactly how much idle
>time you have left, because of the slight of hand that's involved. But
>if you turn HT off you can very accurately tell how much CPU is
>actually being used. So if you're having performance problems, and you
>need to know how much CPU is really being used, that is indeed a very
>good step to take. Turning HT off and running the same scenario again.
>
>On 6/24/05, Sid Stuart <[EMAIL PROTECTED]> wrote:
>
>
>>Actually, the top utility will track utilization across all CPU's quite
>>nicely. No reason to turn HT off to understand what the system is doing.
>>Start the top program and then type 1 (the number one). This should give
>>a load average by CPU display in the summary area.
>>
>>
>
>
>--
>Clayton Macleod
>
>_______________________________________________
>To unsubscribe, edit your list preferences, or view the list archives, please 
>visit:
>http://list.valvesoftware.com/mailman/listinfo/hlds_linux
>
>
>
>
>

--

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux

Reply via email to