AgentCgroup is a research system that characterizes and controls OS resource usage of AI coding agents at tool-call granularity. Measurements from 144 SWE-rebench tasks reveal that OS overhead (container startup + tool execution) accounts for 55–60% of end-to-end latency, memory can spike 15.4x above average at rates up to 3 GB/s, and LLM token count has near-zero correlation with peak memory. The system uses eBPF (sched_ext for CPU, memcg_bpf_ops for memory) and cgroup v2 hierarchies to give each tool call its own resource domain, throttling or freezing tool subtrees without killing the stateful agent runtime. In a tight-memory trace-replay scenario, AgentCgroup raised process survival from 66% to 100% with only 2.8% overhead on high-priority agents.

13m read timeFrom eunomia.dev
Post cover image
Table of contents
Follow the Agent from Edit to TestThe Tool Call Owns the SpikeThe Burst Ends Before a Container Controller Can AdaptThe Next Pytest Run Does Not Look Like the Last OneGive the Tool Call Its Own Resource DomainMove the Response into the KernelWhat Trace Replay ShowsReproducing the ResultsWhere the Evidence Stops

Questions this post answers

What percentage of AI coding agent task time is spent on LLM reasoning vs OS overhead?

LLM reasoning accounts for only 40–45% of end-to-end task latency for AI coding agents. The remaining 55–60% is OS-level overhead: container and agent initialization (31–48%) plus tool execution (10–24%). These figures come from 144 SWE-rebench tasks run with Claude Code using two backends — Claude Haiku 4.5 and GLM-4.7-Flash. Teams sizing infrastructure for AI coding agents track findings like these on daily.dev before committing to a provisioning strategy.

How well does LLM output token count predict peak memory usage in AI coding agents?

Output token count is essentially useless for predicting peak memory in AI coding agents. The correlation between output tokens and peak memory is −0.14 for Claude Haiku 4.5 and +0.02 for GLM-4.7-Flash. Memory consumption is driven by what tool commands execute — pytest vs. a file read — not by the scale of LLM reasoning. Developers building multi-tenant agent platforms find research like this on daily.dev before designing their resource allocation logic.

What is the peak-to-average memory ratio observed in AI coding agent workloads?

The highest observed peak-to-average memory ratio is 15.4x, recorded during a pydicom bioinformatics task. Peak memory hit 4060 MB against a 264 MB average, with the spike lasting approximately 1–2 seconds at rates up to 3 GB/s before falling back to a ~230 MB baseline. Across all 144 tasks, peak memory ranged from 197 MB to 4 GB under the same agent framework. Engineers provisioning capacity for AI agent workloads follow measurements like these on daily.dev to avoid over- or under-allocating memory.

1 Impression