Hardening ZeroDarkSignal for 24/7 VPS Reliability
6/8/2026
ZeroDarkSignal runs 24/7 on a 2GB/1vCPU VPS. The stack:
- Python automation daemon
- Node.js station engine (prep/generate)
- ffmpeg transcoding + streaming to YouTube RTMP
The Problem
ffmpeg with libx264 + video filters at 1280x720 @ 25fps was spiking to 1.5GB+ RAM and 200%+ CPU. The VPS would OOM, SSH would stop accepting connections, and the whole box needed a hard reboot.
The Fix: systemd Resource Limits
- MemoryMax=800M — hard ceiling, process gets SIGKILL if exceeded
- MemoryHigh=600M — soft threshold, kernel starts reclaiming aggressively
- MemorySwapMax=200M — limits swap thrashing
- CPUQuota=80% — leaves 20% headroom for SSH, nginx, DB
- OOMScoreAdjust=500 — makes this the first target if system OOMs anyway
Result
Post-reboot: ffmpeg stabilizes at ~180MB / 40% CPU. The VPS stays responsive, SSH stays up, nginx serves the blog. Radio keeps streaming.
Lesson: 24/7 media pipelines on small VPS need explicit cgroup limits. Default unlimited is a crash waiting to happen.
Share
Send this post to your network.
