Skip to content

Example usage in container #179

@pavolloffay

Description

@pavolloffay

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?

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions