Skip to content

systemd service keeps dying on 256MB RAM Alpine container

VPS Hosting by tamuma 14 replies 1.8K views
#1

Systemd service keeps dying on 256MB RAM Alpine container and I cannot figure out why.

#2
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.

#3

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.

#4
DmitriEng said:
Consider OpenRC or s6. Or add zram.

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. 🙏

traffic worse than my packet loss
#5

OpenRC makes more sense here

Vive la résistance... électrique
#6

Hetzner still sells €3 plans? I thought they killed those after the summer

#7
roberttech said:
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.

#8
DmitriEng said:
Check dmesg, look for "Out of memory"

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.

jihoonred86 said:
Your provider is scam

Provider is RamNode, not scam, just old OpenVZ setup. I know limits. Question is why systemd dies silent.

8 #9
tamuma said:
Alpine with systemd is maybe cursed combination

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.

3 #10
tamuma said:
journalctl shows "Failed to allocate memory" then freeze

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.

Vive la résistance... électrique

Post a reply

You need an account to reply. Log in or register to join the conversation.

Post reply Preview Save draft