tencent cloud

All product documents
Tencent Kubernetes Engine
CPU Hyper-Threading Isolation
Last updated: 2024-12-24 15:40:06
CPU Hyper-Threading Isolation
Last updated: 2024-12-24 15:40:06

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.
img

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:
Thread 1
Thread 2
Action
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

1. Deploy QoS Agent.
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 # Select the Label of the business that needs to lower the priority
resourceQOS:
cpuQOS:
cpuPriority: 0 # Identify as a high-priority business
htIsolation:
enable: true # Enable the CPU HT Isolation capability. 'enable' can be true/false, indicating whether HT isolation is enabled for the business associated with PodQOS

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support