The fine-grained scheduling capability of memory provides a series of features to ensure the service quality for business memories. It comprehensively enhances the memory performance and flexibly limits the memory usage of a container.
Feature 1: Asynchronous Reclamation
Overview
During the memory asynchronous reclamation, a threshold is allowed to be set within the container. Once this threshold is exceeded, backend asynchronous reclamation will be triggered, ensuring a certain amount of idle memory to be used and maintained within the corresponding memcg. It provides assurance for the subsequent memory allocation and reduces the frequency of direct memory reclamation.
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 add-on configuration page for modifying QoS Agent, select Memory QoS Enhancement.
4. Click Complete.
5. Deploy a business.
6. Deploy the PodQOS object associated with the business, and select the business to apply, as shown below:
apiVersion: ensurance.crane.io/v1alpha1
kind: PodQOS
metadata:
name: sql
spec:
labelSelector:
matchLabels:
k8s-app: low
resourceQOS:
memoryQOS:
memAsyncReclaim:
asyncRatio: 90
asyncDistanceFactor: 200
Feature 2: Classification of Global Threshold
Overview
Global threshold classification of the memory means that the cgroups with different priorities have different global memory thresholds; high-priority containers have lower thresholds and are more likely to obtain the memory under the same conditions; and low-priority containers have higher thresholds and are more likely to trigger reclamation to enter the direct reclamation process under the same conditions.
Operation Steps
2. On the Add-on management page in the cluster, locate the successfully deployed QoS Agent, and click the Update Configuration on the right.
3. On the add-on configuration page, select the Memory QoS Enhancement.
4. Click Complete.
5. Deploy a business.
6. Deploy the PodQOS object associated with the business, and select the business to apply, as shown below:
apiVersion: ensurance.crane.io/v1alpha1
kind: PodQOS
metadata:
name: test
spec:
labelSelector:
matchLabels:
k8s-app: low
resourceQOS:
memoryQOS:
memWatermark:
watermarkRatio: 50
Create a PodQOS object for an offline business:
apiVersion: ensurance.crane.io/v1alpha1
kind: PodQOS
metadata:
name: sql
spec:
labelSelector:
matchLabels:
k8s-app: mysql
resourceQOS:
memoryQOS:
memWatermark:
watermarkRatio: -50
Feature 3: pagecache limit
Overview
Isolate the pagecache at the container level.
Operation Steps
2. On the Add-on management page in the cluster, locate the successfully deployed QoS Agent, and click the Update Configuration on the right.
3. On the add-on configuration page, select Memory QoS Enhancement.
4. Click Complete.
5. Deploy a business.
6. Deploy the PodQOS object associated with the business, and select the business to apply, as shown below:
apiVersion: ensurance.crane.io/v1alpha1
kind: PodQOS
metadata:
name: sql
spec:
labelSelector:
matchLabels:
k8s-app: mysql-pi-000006
resourceQOS:
memoryQOS:
memPageCacheLimit:
pageCacheMaxRatio: 20
pageCacheReclaimRatio: 5
Was this page helpful?