The Central Processing Unit (CPU) is the brain of a computer, and for IT professionals, assessing CPU stress is foundational knowledge. However, this task may not be as simple as you think. This is a 4-part article series aim to guide you in evaluating CPU stress.

Part 1: Single-Core CPU Utilization: Demystifies why processes have to wait even when CPU utilization appears low.

Part 2: Multi-Core CPU Utilization: Explores how multiple cores within a CPU complicate the assessment of CPU utilization.

Part 3: CPU Run Queue Size: A more accurate metric for evaluating CPU stress

Part 4: CPU Load: A numerical measure of CPU stress, it differs slightly between Linux and Unix.

Part 2: Multi-Core CPU Utilization

However, this 70% threshold is less relevant in today’s context because it is based on a single CPU. Single CPUs are now typically found only in virtual machines or cloud environments, where the this model does not apply to virtual CPUs. Modern servers are usually equipped with multi-core CPUs, which distribute workload across multiple cores.

To address the complexities of modern multi-core systems, we need to extend our understanding of CPU scheduling probabilities through extrapolation. By considering the probabilities of each core independently and then combining them, we can gain insight into multi-core CPU utilization.

If we assume each core has the same utilization on a two-core CPU, we can calculate the probability of a process being scheduled on at least one CPU/core. Here’s how it works:

  1. 50% Utilization per CPU:
  • The chance of a process not being scheduled on a single CPU is 1/2.
  • For two CPUs, the combined probability of not getting scheduled on either CPU is (1/2)^2 = 1/4.
  • Therefore, the chance of getting scheduled on at least one CPU is 1 – 1/4 = 3/4.

2. 66% Utilization per CPU:

  • The chance of a process not being scheduled on a single CPU is 2/3.
  • The combined probability of not getting scheduled on either CPU is (2/3)^2 = 4/9.
  • The chance of getting scheduled on at least one CPU is 1 – 4/9 = 5/9.

For brevity, we will not extrapolate further, as the rationale is clear. The key takeaway is that the probability of a process being scheduled on at least one CPU is given by the formula: 1 – (1 – u)^n, where u is the utilization and n is the number of CPUs.

As the number of CPUs increases, the overall chance of getting scheduled increases, even if individual CPU utilization is high. The following diagram (though simplified) illustrates the relationship between queuing time and CPU utilization when the number of CPUs is 1, 4, and 8.

As observed, increasing the number of CPUs shifts the “knee” of the response time curve to the right, enabling systems to handle higher loads more effectively. However, as utilization nears full capacity, response times deteriorate rapidly. Therefore, while systems with multiple CPUs scale well for high-concurrency applications, performance can degrade significantly as the CPU load approaches full capacity.

This is the end of Part 2/4. Stay tuned for more.

3 responses to “How to Assess CPU Stress (Part 2/4): Multi-Core CPU Utilization”

  1. How to Assess CPU Stress (Part 1/4): Single-Core CPU Utilization – Yuan Yao, An Oracle ACE's Blog avatar

    […] Part 2: Multi-Core CPU Utilization: Explores how multiple cores within a CPU complicate the assessment of CPU utilization. Here […]

    Like

  2. How to Assess CPU Stress (Part 3/4): CPU Run Queue Size – Yuan Yao, An Oracle ACE's Blog avatar

    […] 2: Multi-Core CPU Utilization: Explores how multiple cores within a CPU complicate the assessment of CPU […]

    Like

  3. How to Assess CPU Stress (Part 4/4): CPU Load – Yuan Yao, An Oracle ACE's Blog avatar

    […] 2: Multi-Core CPU Utilization: Explores how multiple cores within a CPU complicate the assessment of CPU […]

    Like

Leave a reply to How to Assess CPU Stress (Part 3/4): CPU Run Queue Size – Yuan Yao, An Oracle ACE’s Blog Cancel reply

I’m Yuan

Welcome to the blog of a performance maven in Oracle & MySQL. Feel free to contact me to share and discuss database knowledge.

My 20 Oracle Certifications

A screenshot from certview.oracle.com

My Book

MySQL 8.0 Operations and Optimization

Let’s connect