Watch
0
0
Fork
You've already forked hyperhive
0

document budgeted-agent swap and oom metrics; add oom kills panel

This commit is contained in:
atlas 2026-11-11 01:58:30 +01:00
commit c014b48c22

View file

@ -446,7 +446,13 @@ changed cap reaches them at the next container start without a rebuild.
`hyperhive-memory-cap-check.service` logs a warning naming the path in the
container's journal. The container's `MemoryMax=` still applies.
When the container reaches its cap, the kernel kills in this order:
A container with a finite `MemoryMax=` also gets `MemorySwapMax=0` in the same
drop-in, so a budgeted agent never swaps: paging it out to host swap would
move the pressure onto the host. `MemoryMax=infinity` leaves swap alone. Like
the rest of the drop-in, it reaches a running agent at its next spawn or
rebuild.
When the container reaches its cap, the kernel kills inside it, in this order:
1. a subagent run (`oom_score_adj` +1000);
2. a bash task (0);
@ -461,6 +467,13 @@ daemon itself sits in `daemon/` beside them. A daemon that can't set these
up logs one warning at start and runs everything in its own cgroup; subagent
runs still get +1000.
The container stays up through these kills. Each one counts in the
`hyperhive.container.memory.oom_kills` metric, shown as "OOM kills by agent"
on the health tab of the agents dashboard. `hyperhive.container.memory.swap.usage`
is the memory the container has swapped out: nonzero only for an agent with
no budget, or one whose container started before its drop-in carried
`MemorySwapMax=0`.
<details><summary>Implementation: swarm caps</summary>
swarm-controller keeps the caps in the `agent-limits` KV bucket, one key per