Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] unexpected cfs throttles on cpuset pods if cfs_quota_us is set #489

Closed
saintube opened this issue Aug 16, 2022 · 2 comments · Fixed by #662
Closed

[BUG] unexpected cfs throttles on cpuset pods if cfs_quota_us is set #489

saintube opened this issue Aug 16, 2022 · 2 comments · Fixed by #662
Assignees
Labels
area/koordlet kind/bug Create a report to help us improve
Milestone

Comments

@saintube
Copy link
Member

saintube commented Aug 16, 2022

What happened:

When pods are scheduled and started with static CPU binding policy and Linux cpuset controller, we expect that the pod/containers can use all the cpuset CPUs and not get throttled by Linux CFS Bandwidth Control. However, there are results which pods still have chance to get cfs throttled if cpu.cfs_quota_us is set (according to container's CPU limit).

e.g.

Pod A:

      resources:
        limits:
          cpu: "1"
          memory: 2Gi
        requests:
          cpu: "1"
          memory: 2Gi
$ # print pod-level/container-level cfs_quota, cfs_period
$ cat /sys/fs/cgroup/cpu/kubepods.slice/kubepods-podxxx/cpu.cfs_quota_us
100000
$ cat /sys/fs/cgroup/cpu/kubepods.slice/kubepods-podxxx/cpu.cfs_period_us
100000
$ # print pod-level/container-level cpuset
$ cat /sys/fs/cgroup/cpuset/kubepods.slice/kubepods-podxxx/cpuset.cpus
2
$ # run commands inside the pod
$ echo $$ > /sys/fs/cgroup/cpu/kubepods.slice/kubepods-podxxx/cgroup.procs
$ echo $$ > /sys/fs/cgroup/cpuset/kubepods.slice/kubepods-podxxx/cgroup.procs
$ while :; do :; done
$ # check cpu throttled count number (nr_throttled)
$ cat /sys/fs/cgroup/cpu/kubepods.slice/kubepods-podxxx/cpu.stat
nr_periods 3076
nr_throttled 34
throttled_time 12070000

What you expected to happen:

cpuset pods should not have cfs throttles. We may disable cpu.cfs_quota_us for the cpuset pods via the koordlet.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • App version: 0.6.x
  • Kubernetes version (use kubectl version): 1.22
  • Install details (e.g. helm install args):
  • Others:
    • OS Version: Centos 7.9 (kernel 3.10) & Anolis OS 7 (kernel 4.19)

FYI:

@saintube saintube added the kind/bug Create a report to help us improve label Aug 16, 2022
@saintube
Copy link
Member Author

/area koordlet

@jasonliu747 jasonliu747 added this to the someday milestone Aug 29, 2022
@jasonliu747 jasonliu747 modified the milestones: someday, v0.8 Sep 8, 2022
@jasonliu747
Copy link
Member

/assign @saintube

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/koordlet kind/bug Create a report to help us improve
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants