linux-cgroups

Installation
SKILL.md

linux-cgroups

Purpose

This skill enables precise resource management for OpenClaw instances using Linux cgroups v2, focusing on memory limits, CPU quotas, OOM (Out-Of-Memory) protection, and systemd slices to prevent resource exhaustion and optimize performance on multi-process systems.

When to Use

Use this skill when running multiple OpenClaw instances on a Linux server to isolate resources, enforce limits on high-demand tasks, or protect against OOM kills in production environments. Apply it in scenarios with shared hosts, like containers or virtualized setups, to ensure fair CPU and memory allocation.

Key Capabilities

  • Set memory limits to cap usage per OpenClaw instance, e.g., via memory.max to prevent swapping.
  • Enforce CPU quotas using cpu.max for bandwidth control, limiting CPU time slices.
  • Enable OOM protection with memory.oom.group to prioritize processes and avoid abrupt terminations.
  • Manage systemd slices for hierarchical resource grouping, allowing nested cgroups for complex setups.

Usage Patterns

To apply cgroups, create a cgroup hierarchy, set limits, and assign processes. Always run as root or with sufficient privileges. For OpenClaw, wrap instance launches in cgroup contexts to enforce per-instance limits. Example: Create a slice for OpenClaw, then assign processes to it. Use Bash scripts for automation, checking cgroup paths under /sys/fs/cgroup/ for v2.

Related skills
Installs
20
GitHub Stars
5
First Seen
Mar 7, 2026