CPU resource 'limit' value without having integer on pod is not working properly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
StarlingX |
Fix Released
|
Medium
|
Boovan Rajendran |
Bug Description
Brief Description
In terms of CPU setting of Guaranteed QoS on pod, 'limit' without having integer is not working properly.
limit with integer(like 2, 1000m, 2000m) is working normal
limit with non-integer(like 200m, 500m, 1500m) is not working
Severity
Major: System/Feature is usable but degraded
Steps to Reproduce:
[sysadmin@
-------
hostname label key label value
-------
controller-1 kube-cpu-mgr-policy static
-------
# set CPU limit : 200m, and deploy 10 pod
[sysadmin@
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-nginx
spec:
selector:
matchLabels:
run: my-nginx
replicas: 10
template:
metadata:
labels:
run: my-nginx
annotations:
{ "name": "datanet1" }
]'
spec:
nodeSelector:
containers:
- name: mypod
command: ["/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait"]
image: dougbtv/
resources:
limits:
cpu: 200m
memory: 100Mi
requests:
cpu: 200m
memory: 100Mi
#Each pod ran “yes > /dev/null &” in a row to increase CPU load.
# Usage exceeded the limit
[sysadmin@
NAME CPU(cores) MEMORY(bytes)
my-nginx-
my-nginx-
my-nginx-
my-nginx-
my-nginx-
my-nginx-
my-nginx-
my-nginx-
my-nginx-
my-nginx-
#CPU limit=1500 ms, 3 pod deployed -> ISSUE
[sysadmin@
NAME CPU(cores) MEMORY(bytes)
my-nginx-
my-nginx-
my-nginx-
# CPU limit=2000 ms, 3 pod deployed -> NORMAL
[sysadmin@
NAME CPU(cores) MEMORY(bytes)
my-nginx-
my-nginx-
my-nginx-
Expected Behavior
The CPU usage should be limited as 'limit' configured.
Changed in starlingx: | |
assignee: | nobody → Boovan Rajendran (brajendr) |
Changed in starlingx: | |
status: | New → In Progress |
Changed in starlingx: | |
importance: | Undecided → Medium |
Reviewed: https:/ /review. opendev. org/c/starlingx /integ/ +/865313 /opendev. org/starlingx/ integ/commit/ e24f687606d2542 4bfd09dd53c7195 e6d180a069
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit e24f687606d2542 4bfd09dd53c7195 e6d180a069
Author: Boovan Rajendran <email address hidden>
Date: Tue Nov 22 12:10:48 2022 -0500
kubelet CFS quota throttling for non integer cpulimit
This patch is used to set cgroups by writing -1 to cgroup cfs_quota_ us when the cpulimit has integer value.
cpu.
Test Plan: mgr-policy= static" have cpu.cfs_quota_us set to -1 for
Verified the pods that in the "Guaranteed" QoS class, on hosts that
have "kube-cpu-
integer cpu value.
Closes-Bug: #1997528
Signed-off-by: Boovan Rajendran <email address hidden> 483414323db1f2a e0962a466ce
Change-Id: I06a5ea791b9392