Systemd service keeps dying on 256MB RAM Alpine container and I cannot figure out why.
systemd service keeps dying on 256MB RAM Alpine container
YABS
---------------------------------
Processor : AMD EPYC 7443P
CPU cores : 1 @ 2847.000 MHz
AES-NI : ✓ Enabled
VM-x/AMD-V : ✓ Enabled
RAM : 231.4 MiB
Swap : 0.0 KiB
Disk : 9.7 GiB
fio 4k read: 8,247 IOPS
---------------------------------231MB usable on 256MB plan. My €3 Hetzner box gets 11,400 IOPS and 512MB RAM. Your provider is scam. Buy better box, problem solved. Real world use case: you chose wrong. I used https://github.com/masonr/yet-another-bench-script for the numbers above.
Oom-killer very active on low memory box. Alpine good choice but systemd heavy for 256MB. Check dmesg, look for "Out of memory". Cgroup limit maybe lower than expected. I run similar setup on Time4VPS, 512MB, no problem. 256MB too small for systemd. Consider OpenRC or s6. Or add zram. Сервер needs swap or compression. Network not stable without enough RAM for buffer.
I made VPS last month with same problem. Found oom-killer in logs, ja. Added zram and service stable now. Can you share output from dmesg? Also check memory.limit_in_bytes, maybe provider set lower than 256MB. Very tricky some hosts do this. 🙏
OpenRC makes more sense here
Hetzner still sells €3 plans? I thought they killed those after the summer
CX11 is €4.51 now with VAT. Was €2.49 before. I have old one grandfathered. Still best price for AMD EPYC in EU.
Nothing in dmesg. Service just stops, no oom-killer, no signal. journalctl shows "Failed to allocate memory" then freeze. Alpine with systemd is maybe cursed combination.
Provider is RamNode, not scam, just old OpenVZ setup. I know limits. Question is why systemd dies silent.
Not cursed, but Alpine uses musl. Systemd compiled against glibc mostly. Edge repo has systemd but not well tested on 256MB. I tried same on my test box, systemd-journald alone takes 40MB RSS. Add service, you hit wall fast.
RamNode OpenVZ means no zram module maybe. Check /proc/config.gz for CONFIG_ZSMALLOC. If missing, zram not possible.
This. Alpine musl + systemd is known pain. Systemd wants glibc assumptions. On 256MB you lose.
OpenRC uses 3MB. S6 maybe 1MB. Why fight it? RamNode OpenVZ also limits kernel modules, you cannot fix what you cannot load.
I run 128MB Alpine with OpenRC on OVH VPS in Gravelines. Stable two years. €2.99.