Take the catalogue's composition rules into the node-engine
ADR 0593 §7: the composer with its refusals leaves mesh-sdk, so mesh-sdk carries no composition rule. The catalogue functions only the node-engine's composition reaches (Resolve, Resolution's Compose, Declaration, DataItems, LeftOut, Rules and the rest, the settings, placeholder and template refusals, the rendering helpers) are copied with their tests into internal/compose/resolution; a method of a mesh-sdk shape becomes a function taking it first. The composition calls its own copies, and the captured catalogue its tests read lives here now, shared by mesh-compose's tests. Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
# Managed by the mesh (module memory-pressure). Replaced on every push; edit the catalogue instead.
|
||||
#
|
||||
# systemd-oomd kills the worst unit before the kernel's OOM killer freezes the machine: when swap is
|
||||
# 90 % used, or when a watched unit stalls on memory for 20 s above its limit.
|
||||
[OOM]
|
||||
SwapUsedLimit=90%
|
||||
DefaultMemoryPressureLimit=60%
|
||||
DefaultMemoryPressureDurationSec=20s
|
||||
@@ -0,0 +1,5 @@
|
||||
# Managed by the mesh (module memory-pressure). Replaced on every push; edit the catalogue instead.
|
||||
#
|
||||
# systemd-oomd may act on swap exhaustion across the whole machine.
|
||||
[Slice]
|
||||
ManagedOOMSwap=kill
|
||||
@@ -0,0 +1,9 @@
|
||||
# Managed by the mesh (module memory-pressure). Replaced on every push; edit the catalogue instead.
|
||||
#
|
||||
# Swap-in reads one page, not eight: read-ahead exists to amortise a disk's seek, and compressed swap in
|
||||
# RAM has none — the speculation only costs decompression and memory.
|
||||
vm.page-cluster = 0
|
||||
#
|
||||
# vm.swappiness is deliberately left alone. The usual zram advice (150-180) holds only while the
|
||||
# compressed swap has room; once it is full, a higher swappiness moves pages to the disk swap, the thing
|
||||
# being avoided. Raise it only together with zram-size.
|
||||
@@ -0,0 +1,7 @@
|
||||
# Managed by the mesh (module memory-pressure). Replaced on every push; edit the catalogue instead.
|
||||
#
|
||||
# systemd-oomd may kill the worst unit in a person's service manager when its memory pressure stays
|
||||
# above 80 % — instead of the kernel freezing the machine.
|
||||
[Service]
|
||||
ManagedOOMMemoryPressure=kill
|
||||
ManagedOOMMemoryPressureLimit=80%
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
# Managed by the mesh (module memory-pressure). Replaced on every push; edit the catalogue instead.
|
||||
#
|
||||
# Compressed swap in RAM: fast, at a higher priority than any swap on disk, so it takes the everyday
|
||||
# pressure before anything spills to a disk. Half the RAM, at most 16 GiB, compressed with zstd.
|
||||
# The swap on disk, its size and whether one exists at all are the machine's, not this module's.
|
||||
#
|
||||
# Read by the generator at boot: a change applies at the next boot.
|
||||
[zram0]
|
||||
zram-size = min(ram / 2, 16384)
|
||||
compression-algorithm = zstd
|
||||
swap-priority = 100
|
||||
@@ -0,0 +1,130 @@
|
||||
{
|
||||
"module": "memory-pressure",
|
||||
"version": "1",
|
||||
"capabilities": [
|
||||
"package-manager",
|
||||
"service-manager"
|
||||
],
|
||||
"emits": [
|
||||
"pressure.high",
|
||||
"pressure.cleared"
|
||||
],
|
||||
"tools": [
|
||||
"memory_status",
|
||||
"memory_top",
|
||||
"memory_oom_history",
|
||||
"memory_zram",
|
||||
"memory_oomd",
|
||||
"memory_guard"
|
||||
],
|
||||
"resources": [
|
||||
{
|
||||
"id": "zram-generator",
|
||||
"type": "package",
|
||||
"package": "zram-generator"
|
||||
},
|
||||
{
|
||||
"id": "zram",
|
||||
"type": "file",
|
||||
"path": "/etc/systemd/zram-generator.conf",
|
||||
"mode": "0644",
|
||||
"template": "files/zram-generator.conf"
|
||||
},
|
||||
{
|
||||
"id": "sysctl-drop-ins",
|
||||
"type": "directory",
|
||||
"path": "/etc/sysctl.d",
|
||||
"mode": "0755",
|
||||
"unknown": "program"
|
||||
},
|
||||
{
|
||||
"id": "swap-tunables",
|
||||
"type": "file",
|
||||
"path": "/etc/sysctl.d/90-memory-pressure.conf",
|
||||
"mode": "0644",
|
||||
"template": "files/sysctl.conf"
|
||||
},
|
||||
{
|
||||
"id": "sysctl",
|
||||
"type": "service",
|
||||
"unit": "systemd-sysctl.service",
|
||||
"restart-on": [
|
||||
"swap-tunables"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "oomd-drop-ins",
|
||||
"type": "directory",
|
||||
"path": "/etc/systemd/oomd.conf.d",
|
||||
"mode": "0755",
|
||||
"unknown": "program"
|
||||
},
|
||||
{
|
||||
"id": "oomd-limits",
|
||||
"type": "file",
|
||||
"path": "/etc/systemd/oomd.conf.d/memory-pressure.conf",
|
||||
"mode": "0644",
|
||||
"template": "files/oomd.conf"
|
||||
},
|
||||
{
|
||||
"id": "root-slice-drop-ins",
|
||||
"type": "directory",
|
||||
"path": "/etc/systemd/system/-.slice.d",
|
||||
"mode": "0755",
|
||||
"unknown": "program"
|
||||
},
|
||||
{
|
||||
"id": "root-slice",
|
||||
"type": "file",
|
||||
"path": "/etc/systemd/system/-.slice.d/10-oomd.conf",
|
||||
"mode": "0644",
|
||||
"template": "files/root-slice.conf"
|
||||
},
|
||||
{
|
||||
"id": "user-manager-drop-ins",
|
||||
"type": "directory",
|
||||
"path": "/etc/systemd/system/user@.service.d",
|
||||
"mode": "0755",
|
||||
"unknown": "program"
|
||||
},
|
||||
{
|
||||
"id": "user-manager",
|
||||
"type": "file",
|
||||
"path": "/etc/systemd/system/user@.service.d/10-oomd.conf",
|
||||
"mode": "0644",
|
||||
"template": "files/user-manager.conf"
|
||||
},
|
||||
{
|
||||
"id": "oomd",
|
||||
"type": "service",
|
||||
"unit": "systemd-oomd.service",
|
||||
"state": "running",
|
||||
"boot": "enabled",
|
||||
"restart-on": [
|
||||
"oomd-limits",
|
||||
"root-slice",
|
||||
"user-manager"
|
||||
]
|
||||
}
|
||||
],
|
||||
"build": {
|
||||
"artifacts": [
|
||||
{
|
||||
"name": "tools-go",
|
||||
"kind": "bundle",
|
||||
"language": "go",
|
||||
"system": "arch",
|
||||
"from": "cmd/memory-pressure",
|
||||
"binary": "memory-pressure",
|
||||
"loads": [
|
||||
"memory-pressure"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "files",
|
||||
"kind": "archive",
|
||||
"from": "files"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user