arXiv:2602.09345cs.OScs.AI2026-02被引 14

AI代理在云中运行时,资源使用波动大,需按工具调用精细控制。

AgentCgroup: Understanding and Controlling OS Resources of AI Agents

  • 用eBPF在内核层按工具调用分组控制资源,支持动态策略。
  • 实测显示内存占任务延迟60%,峰值比平均高15.4倍。
  • 适合多租户部署的AI代理系统,尤其关注资源隔离与效率。

AI代理在多租户云环境中日益普及,其在沙盒容器内执行多种工具调用,每次调用资源需求不同且变化剧烈。我们对基于SWE-rebench基准的144个软件工程任务(覆盖两个LLM模型)进行了操作系统层面的资源动态系统分析。结果表明:(1) 操作系统级执行(工具调用、容器与代理初始化)占端到端任务延迟的55%-60%;(2) 内存而非CPU是并发瓶颈;(3) 内存峰值由工具调用驱动,最高达平均值的15.4倍;(4) 资源需求在任务、运行和模型间高度不可预测。对比无服务器、微服务和批处理工作负载,发现现有资源控制存在三类错配:粒度错配(容器级策略与工具调用级动态不匹配)、响应性错配(用户态响应滞后于亚秒级突发)、适应性错配(基于历史预测无法应对非确定性有状态执行)。为此提出AgentCgroup,一种基于eBPF的意图驱动资源控制器,利用代理声明资源需求并重构执行策略,通过与工具调用边界对齐的层级cgroup结构,在内核层通过sched_ext和memcg_bpf_ops实现强制执行,并支持运行时自适应策略。初步评估显示其提升了多租户隔离性并减少了资源浪费。代码已开源:https://github.com/eunomia-bpf/agentcgroup

原文摘要 · Abstract (English)

AI agents are increasingly deployed in multi-tenant cloud environments, where they execute diverse tool calls within sandboxed containers, each call with distinct resource demands and rapid fluctuations. We present a systematic characterization of OS-level resource dynamics in sandboxed AI coding agents, analyzing 144 software engineering tasks from the SWE-rebench benchmark across two LLM models. Our measurements reveal that (1) OS-level execution (tool calls, container and agent initialization) accounts for 55-60% of end-to-end task latency; (2) memory, not CPU, is the concurrency bottleneck; (3) memory spikes are tool-call-driven with a up to 15.4x peak-to-average ratio; and (4) resource demands are highly unpredictable across tasks, runs, and models. Comparing these characteristics against serverless, microservice, and batch workloads, we identify three mismatches in existing resource controls: a granularity mismatch (container-level policies vs. tool-call-level dynamics), a responsiveness mismatch (user-space reaction vs. sub-second unpredictable bursts), and an adaptability mismatch (history-based prediction vs. non-deterministic stateful execution). We propose AgentCgroup, an intent-driven eBPF-based resource controller that exploits agents ability to declare resource needs and reconstruct execution strategies, using hierarchical cgroup structures aligned with tool-call boundaries, in-kernel enforcement via sched_ext and memcg_bpf_ops, and runtime-adaptive policies. Preliminary evaluation demonstrates improved multi-tenant isolation and reduced resource waste. AgentCgroup is open-source at https://github.com/eunomia-bpf/agentcgroup

AI代理资源控制eBPF沙盒

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。