Htop – CPU% at 100% but Bar Graph Shows Lower Usage

cpu usagehtop

I'm using Debian 9 to host a game server. Specifically, I'm hosting about 10 instances of the game Don't Starve Together.

The other day I noticed one of those instances (which was getting a lot of player activity) exhibit performance issues. When I loaded up htop I saw that CPU% was reporting 101% but the bar graphs at the top were not showing any cores at much above 50%.

enter image description here

To my knowledge, CPU% shows a sum of the percentages used of each core by a process, so exceeding 100% is normal and no core being above 50% is also normal (it just means the process is quite multi-threaded), however I believe Don't Starve Together is almost entirely a single-threaded application (with minimal multi threading for networking).

One of the bar graphs at the top should be at least over 90%, but none are. Why isn't one of the bar graphs at the top not over 90%? My processor is an i7-6700K (4 core, 8 thread – spec sheet )

Best Answer

Over time, the operating system schedules threads on different CPU cores, so the 101% reported for your processes are potentially distributed over all 8 bars.

Related Question