Why is measuring performance with the CPU a mistake?

Reading Time: < 1 minute

In his Upscale 2018 presentation last march, Brendan Gregg, senior performance architect at Netflix, explains why the CPU isn’t a good metric for measuring performance.

Brendan Gregg, senior performance architect at Netflix”
Everyone uses %CPU to measure performance, but everyone is wrong

This is an opportunity for us to revisit what we have been pushing for a long time: How to measure performance and resource consumption reliably?

Brendan Gregg explains that the CPU rate can indicate false information. For instance, a busy CPU doesn’t necessarily indicate that the CPU is busy doing calculations but is waiting for information. It’s therefore necessary to use more advanced tools to analyze what happens in the lower layers of the code. Brendan Gregg even concludes that this problem will get worse with the acceleration of processor speed.

We have observed this phenomenon through our R&D. Indeed, a high CPU rate doesn’t necessarily mean that the CPU is requested and conversely a low CPU could hide overconsumption from another cache.

The problem is even more present in mobility. Indeed, the current platforms are heterogeneous: CPU, GPU, Radio, multiple interfaces… It’s therefore complex to follow the current performance of these platforms and it’s necessary to use various and complex profiling tools.

Our approach at Greenspector is different, we propose to use energy as a more reliable metric. Any component solicited consumes energy, monitoring energy consumption will detect over-consumption of resources.

For more information, we invite you to read our article Why you should measure the energy consumption of your software?.