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

stats doesn't work on cgroup v2 #162

Closed
Mossaka opened this issue Aug 2, 2023 · 1 comment · Fixed by #163
Closed

stats doesn't work on cgroup v2 #162

Mossaka opened this issue Aug 2, 2023 · 1 comment · Fixed by #163

Comments

@Mossaka
Copy link
Member

Mossaka commented Aug 2, 2023

When I ran ctr task metric <task-name>, the container runtime returns a rpc error, indicating that the metric collecting method doesn't work on cgroup v2. I think I know the issue lies in the collect_metric method. Will have a PR to fix it.

Reproduce

➜  rust-extensions-fork git:(main) sudo ctr run --net-host --rm --runtime=io.containerd.runc.v2-rs docker.io/library/py-flask-app:latest pyflask
 * Serving Flask app 'app'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:8000
 * Running on http://10.0.0.4:8000
Press CTRL+C to quit
ctr: rpc error: code = Unknown desc = ttrpc: closed: unknown
➜  runwasi git:(issue64) ✗ sudo ctr task metric pyflask         
ctr: not found
@Mossaka
Copy link
Member Author

Mossaka commented Aug 2, 2023

I verified that stats() does work on cgroup v1 Linux

~ sudo ctr task metric nginx                                                                          
ID       TIMESTAMP                              
nginx    seconds:1690942917  nanos:205307933    

METRIC                   VALUE       
memory.usage_in_bytes    3174400     
memory.limit_in_bytes    0           
memory.stat.cache        0           
cpuacct.usage            37091300    
cpuacct.usage_percpu     []      

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant