6/22 I'm doing some performance tuing of a multithreaded application on a
dual-Xeon with hyperthreading. Windows reports 4 cores and counts
1 core @ 100% as 25% CPU usage. I realize this is a fuzzy question,
but what's a reasonable real-world limit for CPU usage in this
situation, since there aren't really 4 cores? This app has a mix of
MMX computation, unaccelerated floating-point math, bus I/O, and a
lot of pointer dereferencing / irregular memory access patterns.
\_ Turn off hyperthreading.
\_ Since I currently get around 60% reported CPU usage, it would
seem hyperthreading is helping performance about 20%, right?
\_ The general wisdom is that hyperthreading increases GUI
responsiveness but decreases overall performance by 0-5%.
I'm sure there's an example where hyperthreading increases
overall performance, but I can't think of one.
\_ Run your app with it on and off. Compare the run times.
\_ Just tried that. Hyperthreading on: 200 seconds
Hyperthreading off: 220 seconds
\_ I'm doing the same with a simulation app. It hits the memory bus
and CPU most. HT actually slowed our system down considerably. A
dual xeon gave us about 2x speed improvement. The dual opteron did
the same. We're now checking a dual opteron with each package
having dual core. I say this as a former Intel employee who likes
Intel--HT sucks for anything other than casual use. Hard. -emarkp
\_ I agree. If yer doing simulations or anything else hardcore,
turn off HT. If yer doing Word and net browsing, by all means
turn it on because it's a more pleasant user experience.
Or wait until the Athlon dual-cores drop from $630.
Or don't wait and get an Intel dual-core for $250 if your room is
too cold.
\_ OK, so aside from dissing hyperthreading, nobody has given actual
information on what is a realistic maximum load for a 2-Xeon
hyperthreading system. -OP
\_ I think you should rephrase your question. What are you
asking? What parameter(s) do you wish to change that are
under your control? The load should be 2 at most, since
there are 2 CPUs. Play with it and see what happens when you
run more processes.
\_ Do you have two dual-core CPUs with hyperthreading enabled?
That implies eight logical CPUs.
If you disabled hyperthreading, then you have four logical CPUs
and four real cores. You should get theoretical 100% usage on
each core. The simplest way to do this is to write a C program
with a while (1) loop and run it four times.
We have an old 700 MHz 4-CPU machine at work, and I can get about
that running Linux with top.
For one or more real-world apps that each uses multiple threads,
it really depends on the threading implementation in each program,
followed by how good the kernel is at handing out tasks to 4+ CPUs.
I can easily imagine a two-thread program that uses 100% CPU on
one CPU and 25% CPU on a second.
\_ I have two dual-core dual processor machines with hyperthreading
enabled ......
\_ So each machine has one dual-core with hyperthreading?
Yeah, then that means four logical CPUs, two real cores,
per computer.
You can only expect a maximum of 100% CPU usage over the
two logical CPUs that sit on one physical core.
Anyways, if you run four while (1) C programs you should
get 200% total over the four CPUs as reported by top.
Same thing for Windoze if you have four CPU graphs. |