{"repo":"containerd/cgroups","free":true,"listed":false,"github":"https://github.com/containerd/cgroups","clone":"git clone https://github.com/containerd/cgroups.git","description":"cgroups package for Go","language":"Go","stars":1191,"topics":["cgroups","golang","linux"],"license":"Apache-2.0","category":"dev-tools","readme_excerpt":"cgroups Go package for creating, managing, inspecting, and destroying cgroups. The resources format for settings on the cgroup uses the OCI runtime-spec found here. Examples (v1) Create a new cgroup This creates a new cgroup using a static path for all subsystems under /test . /sys/fs/cgroup/cpu/test /sys/fs/cgroup/memory/test etc.... It uses a single hierarchy and specifies cpu shares as a resource constraint and uses the v1 implementation of cgroups. Create with systemd slice support Load an existing cgroup Add a process to the cgroup Update the cgroup To update the resources applied in the cgroup Freeze and Thaw the cgroup List all processes in the cgroup or recursively Get Stats on the cgroup By adding cgroups.IgnoreNotExist all non-existent files will be ignored, e.g. swap memory stats without swap enabled Move process across cgroups This allows you to take processes from one cgroup and move them to another. Create subcgroup Registering for memory events This allows you to get notified by an eventfd for v1 memory cgroups events. Examples (v2/unified) Check that the current system is running cgroups v2 Create a new cgroup This creates a new systemd v2 cgroup slice. Systemd slices consider \"-\" a special character, so the resulting slice would be located here on disk: /sys/fs/cgroup/my.slice/my-cgroup.slice/my-cgroup-abc.slice Load an existing cgroup Delete a cgroup Kill all processes in a cgroup Get and set cgroup type Attention All static path should not include /sys/fs/c","default_branch":null,"files":null,"tree":[],"storefront":"/r/containerd","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/containerd/cgroups/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}