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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

coder stat cpu fails in docker workspace #8468

Closed
sharkymark opened this issue Jul 12, 2023 · 2 comments 路 Fixed by #8591
Closed

coder stat cpu fails in docker workspace #8468

sharkymark opened this issue Jul 12, 2023 · 2 comments 路 Fixed by #8591
Assignees
Labels
bug Used to filter all bug issues s2 Broken use cases or features (with a workaround). Only humans may set this.

Comments

@sharkymark
Copy link
Contributor

Version: v0.26.0+bf8af90

coder stat mem works but coder stat cpu does not

馃  ~ $ coder stat mem
0.201/0.769 GiB (26%)
馃  ~ $ coder stat cpu
running command "coder stat cpu": get total cpu:                                
    github.com/coder/coder/cli/clistat.(*Statter).ContainerCPU                  
        /home/runner/actions-runner/_work/coder/coder/cli/clistat/cgroup.go:62  
  - read cpu period:                                                            
    github.com/coder/coder/cli/clistat.(*Statter).cGroupV1CPUTotal              
        /home/runner/actions-runner/_work/coder/coder/cli/clistat/cgroup.go:156 
  - read /sys/fs/cgroup/cpu,cpuacct/cpu.cfs_period_us:                          
    github.com/coder/coder/cli/clistat.readInt64                                
        /home/runner/actions-runner/_work/coder/coder/cli/clistat/cgroup.go:277 
  - open /sys/fs/cgroup/cpu,cpuacct/cpu.cfs_period_us: no such file or directory
@cdr-bot cdr-bot bot added the bug Used to filter all bug issues label Jul 12, 2023
@matifali
Copy link
Collaborator

related to #8416

@johnstcn
Copy link
Member

@sharkymark could you provide:

  • Host OS / version
  • Docker version
  • The output (inside Docker container) of ls -l /sys/fs/cgroup/

@johnstcn johnstcn self-assigned this Jul 13, 2023
@matifali matifali added the s2 Broken use cases or features (with a workaround). Only humans may set this. label Jul 14, 2023
johnstcn added a commit that referenced this issue Jul 19, 2023
* Attempts reading cgroupv1 quota, period, usage from /sys/fs/cgroup/cpu,cpuacct by default
* Fall back to /sys/fs/cgroup/cpu for v1 quota and period
* Fall back to /sys/fs/cgroup/cpuacct for v1 usage

Fixes #8468
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to filter all bug issues s2 Broken use cases or features (with a workaround). Only humans may set this.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants