# htop CPU graph doesn't match numbers



## Elliott (Oct 4, 2019)

I am trying to improve Samba performance on a server with 40GbE.  Samba server is single threaded, so htop shows it pegged at 100%.  But why do the bar graphs at the top show differently?  I would expect one core to pe pegged at 100%.


----------



## PacketMan (Oct 4, 2019)

I really don't know the true answer to this, but based on observations I have come to the conclusion that FreeBSD (and likely many other OSs) flip the process threads around on the CPU cores. So for a few cycles its on one core, then another, then another, etc.  Since top shows you an interval, you will likely never see a cpu core at 100% with all others at 0%.  That is my guess.

Why heat up one core super hot with the rest being cool? Spread the heat around I say.

Now we wait for the real answer.


----------



## Elliott (Oct 4, 2019)

Good guess, but `yes>/dev/null &` stays on one core so what's the difference?
I believe moving between cores would create some unnecessary latency.  Whether this is actually noticeable I don't know.  But some modern CPUs use Turbo Boost to overclock one core, so this could have a significant performance impact.


----------

