A pinned sweep worker cannot leave its cpu, so any sustained cpu-bound process allowed there collapsed the session runtime to 0.14x real time. flysim and flysim-session now run in flysim.slice (AllowedCPUs = the sim's set) and bin/fly-cpu-confine, run by their ExecStartPre, confines system.slice, user.slice and init.scope to the other cpus. It refuses while a sim unit still sits outside the slice (shrinking system.slice under it would make it float). Without a partition the deploy writes FLY_SESSION_PIN=0. fly-recap and fly-retention run at SCHED_IDLE. The drop-in plan is one function (cpuset_dropin_plan) shared by the deploy and lint; lint covers the plan, the units, the deploy wiring and fly-cpu-confine against a stub systemctl and a fake /proc. Runbook and README updated.
17 lines
708 B
Desktop File
17 lines
708 B
Desktop File
# infra/units/fly-retention.service — triggered by fly-retention.timer
|
|
# (also invoked directly by fly-watchdog's disk guard, see bin/fly-watchdog).
|
|
[Unit]
|
|
Description=Prune old segments, highlights, and orphan checkpoints
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
User=fly
|
|
Environment=FLY_STATE_DIR=/srv/fly/state
|
|
Environment=FLY_MEDIA_DIR=/srv/fly/media
|
|
ExecStart=/opt/fly/bin/fly-retention
|
|
Nice=15
|
|
IOSchedulingClass=idle
|
|
# Batch work never competes with anything: idle policy (Nice and CPUWeight are moot under it). The
|
|
# sim's CPUs are out of its reach anyway (fly-cpu-confine); this keeps it off the page's and the
|
|
# encoder's too. SCHED_IDLE measured harmless beside the pinned sweep workers.
|
|
CPUSchedulingPolicy=idle
|