containerd / containerd/cgroups

Example usage in container

Open
#179 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.2k
Forks
252
PR merge metrics
No merged PRs in 30d

Description

Hi,

sorry for creating an issue but I didn't know where to ask a quesiton.

Can this library be used in a running container to get cgroups memory limits? I would like to get value of `/sys/fs/cgroup/memory/memory.limit_in_bytes`. Probably it's not safe to read that file directly hence I would like to use this lib to get the `memory_limit_in_bytes`.

How should be the cgroups created?
```go
control, err := cgroups.Load(cgroups.V1, cgroups.NestedPath("")) //always error
```

Creating it by PID does not work either as the `os.Getpid()` returns 1 in the container.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.