mosn / holmes

self-aware Golang profile dumper
Apache License 2.0
1.06k stars 135 forks source link

get CPU core failed #135

Closed istudies closed 1 year ago

istudies commented 1 year ago

Set holmes.WithCGroup(true) in the docker container. The log message indicates that the cpu core failed to be obtained.

2023-01-05 14:53:05,141 [INFO] [Holmes] use cgroup to limit memory
2023-01-05 14:53:05,143 [INFO] [Holmes] collect interval is resetting to [10s]
2023-01-05 14:53:15,144 [ERROR] [Holmes] get CPU core failed, CPU core: 0, error: <nil>

cgroup version: v1

root@master:/root# grep cgroup /proc/filesystems
nodev   cgroup
istudies commented 1 year ago

Should be caused by not adding the resource limit. After starting with the resource limit, it looks OK

docker-compose.yaml

    ...
    deploy:
      resources:
        limits:
          cpus: '2'
          memory: 2g
   ...
doujiang24 commented 1 year ago

@istudies Thanks for your reporting. Could you help to add a comment for this WithCGroup method? Thanks again.

istudies commented 1 year ago

@doujiang24 https://github.com/mosn/holmes/pull/136 PTAL