default.nix
1# hosts/infra-mymood-at/default.nix
2# Host-specific settings for infra.mymood.at (netcup, 4 vCPU, 7.75 GiB), the
3# shared box: moods now, sovrn's metrics stack and backup mail relay next
4# (plan phase 8). Disk, boot and network come from modules/vm.nix and
5# modules/netcup.nix.
6{ ... }:
7{
8 # Guard rails for sharing (plan 3.3). The embedder is the box's one heavy
9 # process: about 1.75 GB resident and ~1.4 cores on average. Bound it so a
10 # backlog can't starve Stalwart or Alertmanager once they live here.
11 systemd.services.moods-embedder.serviceConfig = {
12 MemoryHigh = "2.5G"; # throttled and reclaimed above this
13 MemoryMax = "3G"; # killed (and restarted) above this
14 CPUWeight = 50; # half the default share when the CPU is contended
15 };
16
17 # No swap before: a memory spike went straight to the OOM killer. zram is a
18 # compressed cushion in RAM (no disk layout change, no I/O on netcup's
19 # shared storage), not extra capacity.
20 zramSwap = {
21 enable = true;
22 memoryPercent = 25;
23 };
24}