|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * scalability_and_performance/cnf-numa-aware-scheduling.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: CONCEPT |
| 6 | +[id="cnf-numa-resource-scheduling-strategies_{context}"] |
| 7 | += NUMA resource scheduling strategies |
| 8 | + |
| 9 | +When scheduling high-performance workloads, the secondary scheduler can employ different strategies to determine which NUMA node within a chosen worker node will handle the workload. The supported strategies in {product-title} include `LeastAllocated`, `MostAllocated`, and `BalancedAllocation`. Understanding these strategies helps optimize workload placement for performance and resource utilization. |
| 10 | + |
| 11 | +When a high-performance workload is scheduled in a NUMA-aware cluster, the following steps occur: |
| 12 | + |
| 13 | +. The scheduler first selects a suitable worker node based on cluster-wide criteria. For example taints, labels, or resource availability. |
| 14 | + |
| 15 | +. After a worker node is selected, the scheduler evaluates its NUMA nodes and applies a scoring strategy to decide which NUMA node will handle the workload. |
| 16 | + |
| 17 | +. After a workload is scheduled, the selected NUMA node’s resources are updated to reflect the allocation. |
| 18 | + |
| 19 | +The default strategy applied is the `LeastAllocated` strategy. This assigns workloads to the NUMA node with the most available resources that is the least utilized NUMA node. The goal of this strategy is to spread workloads across NUMA nodes to reduce contention and avoid hotspots. |
| 20 | + |
| 21 | +The following table summarizes the different strategies and their outcomes: |
| 22 | + |
| 23 | +[discrete] |
| 24 | +[id="cnf-scoringstrategy-summary_{context}"] |
| 25 | +== Scoring strategy summary |
| 26 | + |
| 27 | +.Scoring strategy summary |
| 28 | +[cols="2,3,3", options="header"] |
| 29 | +|=== |
| 30 | +|Strategy |Description |Outcome |
| 31 | +|`LeastAllocated` |Favors NUMA nodes with the most available resources. |Spreads workloads to reduce contention and ensure headroom for high-priority tasks. |
| 32 | +|`MostAllocated` |Favors NUMA nodes with the least available resources. |Consolidates workloads on fewer NUMA nodes, freeing others for energy efficiency. |
| 33 | +|`BalancedAllocation` |Favors NUMA nodes with balanced CPU and memory usage. |Ensures even resource utilization, preventing skewed usage patterns. |
| 34 | +|=== |
| 35 | + |
| 36 | +[discrete] |
| 37 | +[id="cnf-leastallocated-example_{context}"] |
| 38 | +== LeastAllocated strategy example |
| 39 | +The `LeastAllocated` is the default strategy. This strategy assigns workloads to the NUMA node with the most available resources, minimizing resource contention and spreading workloads across NUMA nodes. This reduces hotspots and ensures sufficient headroom for high-priority tasks. Assume a worker node has two NUMA nodes, and the workload requires 4 vCPUs and 8 GB of memory: |
| 40 | + |
| 41 | +.Example initial NUMA nodes state |
| 42 | +[cols="5,2,2,2,2,2", options="header"] |
| 43 | +|=== |
| 44 | +|NUMA node |Total CPUs |Used CPUs |Total memory (GB) |Used memory (GB) |Available resources |
| 45 | +|NUMA 1 |16 |12 |64 |56 |4 CPUs, 8 GB memory |
| 46 | +|NUMA 2 |16 |6 |64 |24 |10 CPUs, 40 GB memory |
| 47 | +|=== |
| 48 | + |
| 49 | +Because NUMA 2 has more available resources compared to NUMA 1, the workload is assigned to NUMA 2. |
| 50 | + |
| 51 | +[discrete] |
| 52 | +[id="cnf-mostallocated-example_{context}"] |
| 53 | +== MostAllocated strategy example |
| 54 | +The `MostAllocated` strategy consolidates workloads by assigning them to the NUMA node with the least available resources, which is the most utilized NUMA node. This approach helps free other NUMA nodes for energy efficiency or critical workloads requiring full isolation. This example uses the "Example initial NUMA nodes state" values listed in the `LeastAllocated` section. |
| 55 | + |
| 56 | +The workload again requires 4 vCPUs and 8 GB memory. NUMA 1 has fewer available resources compared to NUMA 2, so the scheduler assigns the workload to NUMA 1, further utilizing its resources while leaving NUMA 2 idle or minimally loaded. |
| 57 | + |
| 58 | +[discrete] |
| 59 | +[id="cnf-balanceallocated-example_{context}"] |
| 60 | +== BalancedAllocation strategy example |
| 61 | +The `BalancedAllocation` strategy assigns workloads to the NUMA node with the most balanced resource utilization across CPU and memory. The goal is to prevent imbalanced usage, such as high CPU utilization with underutilized memory. Assume a worker node has the following NUMA node states: |
| 62 | + |
| 63 | +.Example NUMA nodes initial state for `BalancedAllocation` |
| 64 | +[cols="2,2,2,2",options="header"] |
| 65 | +|=== |
| 66 | +|NUMA node |CPU usage |Memory usage |`BalancedAllocation` score |
| 67 | +|NUMA 1 |60% |55% |High (more balanced) |
| 68 | +|NUMA 2 |80% |20% |Low (less balanced) |
| 69 | +|=== |
| 70 | + |
| 71 | +NUMA 1 has a more balanced CPU and memory utilization compared to NUMA 2 and therefore, with the `BalancedAllocation` strategy in place, the workload is assigned to NUMA 1. |
| 72 | + |
0 commit comments