bash tasks are the OOM killer's first victims: score 1000, subagent runs 900, MemoryHigh on the bash daemon
This commit is contained in:
parent
d4dc8b48b1
commit
77f33a23d8
1 changed files with 155 additions and 32 deletions
|
|
@ -31,8 +31,10 @@ let
|
|||
# The ceiling is sized at boot from the container's cap
|
||||
# (../agent-modules/memory-cap.nix). One in the unit would be the cap at
|
||||
# the last rebuild, and every agent would carry its own hive's number.
|
||||
name = "the subagent daemon's memory ceiling is not built into its unit";
|
||||
ok = !((agentSubagentDaemon agentDefault).serviceConfig ? MemoryHigh);
|
||||
name = "the subagent and bash daemons' memory ceiling is not built into their units";
|
||||
ok =
|
||||
!((agentSubagentDaemon agentDefault).serviceConfig ? MemoryHigh)
|
||||
&& !((agentBashDaemon agentDefault).serviceConfig ? MemoryHigh);
|
||||
}
|
||||
{
|
||||
# claude's heap ceiling reaches it only as inherited environment: the
|
||||
|
|
@ -55,11 +57,12 @@ let
|
|||
&& lib.elem "multi-user.target" agentDefault.systemd.services.hyperhive-memory-cap-check.wantedBy;
|
||||
}
|
||||
{
|
||||
# A HIGHER OOMScoreAdjust is a MORE likely victim. The subagent daemon
|
||||
# puts each run at +1000 itself and bash tasks stay at 0, so the harness
|
||||
# must sit below 0 for the agent's own session to go last. Neither
|
||||
# daemon unit carries a value: it would make the idle daemon a likelier
|
||||
# victim than a bash task, and a floor no run under it could go below.
|
||||
# A HIGHER OOMScoreAdjust is a MORE likely victim. The bash daemon puts
|
||||
# each task at +1000 and the subagent daemon each run at +900 itself
|
||||
# (`hive_agent_sock::run_cgroup`), so the harness must sit below 0 for the
|
||||
# agent's own session to go last. Neither daemon unit carries a value: it
|
||||
# would make the idle daemon a likelier victim than a task, and a floor no
|
||||
# run under it could go below.
|
||||
name = "the OOM killer takes the agent's own session last";
|
||||
ok =
|
||||
(agentHarness agentDefault).serviceConfig.OOMScoreAdjust < 0
|
||||
|
|
|
|||
Loading…
Reference in a new issue