swarm_runner: runner-unit memory fence 6G/8G, and an override now fails the play (#20) #21
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/matou-distributed-servers!21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ben/fix/swarm-runner-fence-memory"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refs #20. This is the repo half; the issue stays open until the play has run on elitebook-03.
What was wrong
The fence on
forgejo-runner-swarm.servicewasMemoryHigh=2G/MemoryMax=3G, sized for one job. The runner takes two at once, and on 2026-09-25 the two were throttled into swap thrash. Asystemctl set-propertyhad already raised the limit to 6G/8G, but its drop-ins (50-MemoryHigh.conf,50-MemoryMax.conf) sort before50-swarm-fence.conf, so the fence won.What changes
swarm_runner_unit_memory_high(6G) andswarm_runner_unit_memory_max(8G). CPU/IO weights are unchanged./etc/systemd/system.control/forgejo-runner-swarm.service.d/50-Memory*.confdrop-ins.set-property --runtimehint is removed, and a fence change no longer prints the "restart manually" notice.Checked
All on local systemd 255 with throwaway user units, ansible-core 2.21.1:
50-MemoryHigh.conf/50-MemoryMax.confat 2G/3G loads 6G/8G.memory.high2G to 6G on daemon-reload alone, same PID.60-override.confat 2G/3G; fails with its message oninfinity.ansible-playbook playbooks/swarm-runner.yml --syntax-checkpasses.ansible-lintreports nothing new.Not run against elitebook-03. The host's system manager is assumed to behave like the local user manager.
Review
Three-axis review (standards, spec, failure path). No hard violations; the assert can fire. Follow-ups are in the second commit.
Known and left alone: the runner unit (8G) and the swarm user slice (10G) are separate cgroups, so their caps sum to 18G on a host with about 15G. Caps are not reservations, and the issue asked for 6G/8G. Nothing in the repo reserves memory for etcd (
MemoryLow/MemoryMin); only CPU/IO weights protect it.After merge
make swarm-runner LIMIT=elitebook-distributed-server-03. No restart is needed.cat /sys/fs/cgroup/system.slice/forgejo-runner-swarm.service/memory.highshould read6442450944./at 96% on matou-dev-server-01.🤖 Generated with Claude Code