Overview
Common SMP processors have multiple levels, including the structures of threads, physical cores, and processors. When hyper-threading (HT) is enabled, a physical core typically contains 2 threads, and both threads on the same core share the L2 Cache.
When high-priority containers and low-priority containers run simultaneously, the threads of high-priority containers may be executed on the same physical core or even on the same HT CPU as the thread of the low-priority containers. In this case, although the CPU Usage Priority ensures that the threads of high-priority containers can always preempt the threads of low-priority containers, the threads of low-priority containers will occupy the shared L2 Cache on the physical core as long as they run, affecting the L2 Cache for high-priority container threads. To prevent the L2 Cache for the threads of high-priority containers from being affected by the threads of low-priority containers running on the same physical core, the QoS Agent introduces the HT isolation mechanism. When there are rich processor resources, it ensures that there is no interference from threads of low-priority containers on the physical cores for the threads of high-priority containers.
HT interference isolation policies in different scenarios:
|
High priority | High priority | Take no action |
High priority | Low priority | Throttle low-priority tasks on siblings and restrict the migration of these low-priority tasks to siblings at the Cloud Load Balancer (CLB). |
Low priority | Low priority | Try to pull high-priority tasks from other cores. |
Operation Steps
2. On the Add-on Management page in the cluster, locate the successfully deployed QoS Agent, and click Update Configuration on the right.
3. On the configuration page for modifying the QoS Agent component, select CPU HT Isolation.
4. Select CPU Usage Priority to identify a high-priority business.
5. Click Complete.
6. Deploy a business.
7. Deploy the PodQOS objects associated with this business, and select the Label of the Workload that needs to use HT Isolation, as shown below:
apiVersion: ensurance.crane.io/v1alpha1
kind: PodQOS
metadata:
name: ht-1
spec:
labelSelector:
matchLabels:
k8s-app: memcached
resourceQOS:
cpuQOS:
cpuPriority: 0
htIsolation:
enable: true
Was this page helpful?