Skip to content

Commit

Permalink
fix be hostapp default cgroup path
Browse files Browse the repository at this point in the history
Signed-off-by: acejilam <acejilam@gmail.com>
  • Loading branch information
ls-2018 committed Apr 8, 2024
1 parent 8205cc3 commit d3ad6c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ $ cat /sys/fs/cgroup/cpuset/cpuset.cpus > /sys/fs/cgroup/cpuset/host-latency-sen
$ cat /sys/fs/cgroup/cpuset/cpuset.mems > /sys/fs/cgroup/cpuset/host-latency-sensitive/cpuset.mems
$ cat /sys/fs/cgroup/cpuset/cpuset.mems > /sys/fs/cgroup/cpuset/host-latency-sensitive/nginx/cpuset.mems

# bind application to corresponding cgroups
# bind application to corresponding cgroups
$ echo ${your-application-pids} > /sys/fs/cgroup/cpuset/host-latency-sensitive/nginx/tasks
$ echo ${your-application-pids} > /sys/fs/cgroup/cpu/host-latency-sensitive/nginx/tasks
```
Expand Down Expand Up @@ -94,7 +94,7 @@ metadata:
| `qos` | String | LS/BE | 宿主机带外应用的QoS等级。 |
| `cgroupPath` | CgroupPath | N/A | 宿主机带外应用对应的cgroup分组,实际目录为`${base}/${parentDir}/${relativePath}`组成。 |
| `cgroupPath.base` | String | CgroupRoot/Kubepods/KubepodsBurstable/KubepodsBesteffort | cgroup分组的根目录,枚举类型,实际目录与cgroup驱动有关。 |
| `cgroupPath.parentDir` | String | N/A | cgroup分组的父目录,LS对应的默认值为"host-latency-sensitive/",BE对应的默认值为"host-latency-sensitive/"。 |
| `cgroupPath.parentDir` | String | N/A | cgroup分组的父目录,LS对应的默认值为"host-latency-sensitive/",BE对应的默认值为"host-best-effort/"。 |
| `cgroupPath.relativePath` | String | N/A | cgroup分组的子目录。 |

3. 查看安装的命名空间下是否存在ConfigMap,以命名空间`koordinator-system`和ConfigMap名字`slo-controller-config`为例,具体以实际安装配置为准。
Expand All @@ -110,7 +110,7 @@ metadata:
```bash
kubectl apply -f configmap.yaml
```

4. 检查带外应用nginx对应的cgroup配置,其中CPU QoS策略的cgroup配置文件`cpu.bvt_warp_ns`应与QoS等级LS的配置一致,cpuset核心应与节点的share pool一致,
示例如下:
```shell script
Expand All @@ -122,4 +122,4 @@ $ 1-5,8-23,32-47,50-51,53,56-71,80-103
$ kubectl get noderesourcetopology ${your-node-id} -o yaml | grep node.koordinator.sh/cpu-shared-pools
node.koordinator.sh/cpu-shared-pools: '[{"socket":0,"node":0,"cpuset":"1-5,8-23,53,56-71"},{"socket":1,"node":1,"cpuset":"32-47,50-51,80-103"}]'
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ $ cat /sys/fs/cgroup/cpuset/cpuset.cpus > /sys/fs/cgroup/cpuset/host-latency-sen
$ cat /sys/fs/cgroup/cpuset/cpuset.mems > /sys/fs/cgroup/cpuset/host-latency-sensitive/cpuset.mems
$ cat /sys/fs/cgroup/cpuset/cpuset.mems > /sys/fs/cgroup/cpuset/host-latency-sensitive/nginx/cpuset.mems

# bind application to corresponding cgroups
# bind application to corresponding cgroups
$ echo ${your-application-pids} > /sys/fs/cgroup/cpuset/host-latency-sensitive/nginx/tasks
$ echo ${your-application-pids} > /sys/fs/cgroup/cpu/host-latency-sensitive/nginx/tasks
```
Expand Down Expand Up @@ -94,7 +94,7 @@ metadata:
| `qos` | String | LS/BE | 宿主机带外应用的QoS等级。 |
| `cgroupPath` | CgroupPath | N/A | 宿主机带外应用对应的cgroup分组,实际目录为`${base}/${parentDir}/${relativePath}`组成。 |
| `cgroupPath.base` | String | CgroupRoot/Kubepods/KubepodsBurstable/KubepodsBesteffort | cgroup分组的根目录,枚举类型,实际目录与cgroup驱动有关。 |
| `cgroupPath.parentDir` | String | N/A | cgroup分组的父目录,LS对应的默认值为"host-latency-sensitive/",BE对应的默认值为"host-latency-sensitive/"。 |
| `cgroupPath.parentDir` | String | N/A | cgroup分组的父目录,LS对应的默认值为"host-latency-sensitive/",BE对应的默认值为"host-best-effort/"。 |
| `cgroupPath.relativePath` | String | N/A | cgroup分组的子目录。 |

3. 查看安装的命名空间下是否存在ConfigMap,以命名空间`koordinator-system`和ConfigMap名字`slo-controller-config`为例,具体以实际安装配置为准。
Expand All @@ -110,7 +110,7 @@ metadata:
```bash
kubectl apply -f configmap.yaml
```

4. 检查带外应用nginx对应的cgroup配置,其中CPU QoS策略的cgroup配置文件`cpu.bvt_warp_ns`应与QoS等级LS的配置一致,cpuset核心应与节点的share pool一致,
示例如下:
```shell script
Expand All @@ -122,4 +122,4 @@ $ 1-5,8-23,32-47,50-51,53,56-71,80-103
$ kubectl get noderesourcetopology ${your-node-id} -o yaml | grep node.koordinator.sh/cpu-shared-pools
node.koordinator.sh/cpu-shared-pools: '[{"socket":0,"node":0,"cpuset":"1-5,8-23,53,56-71"},{"socket":1,"node":1,"cpuset":"32-47,50-51,80-103"}]'
```
```

0 comments on commit d3ad6c9

Please sign in to comment.