atproto relay in zig zlay.waow.tech
relay zig atproto

stagger startup connections across 30s window to survive health probes master

all ~2,800 subscriber threads were starting DNS+TLS handshakes simultaneously during startup, starving the HTTP server thread and causing kubelet to kill the pod on liveness probe timeout. each subscriber now sleeps a deterministic jitter (0-30s, based on host_id hash) before its first connection attempt. threads still spawn quickly (50/batch, 100ms yield) but actual handshakes are spread across a 30-second window instead of hitting all at once. jitter only applies to startup — requestCrawl and reconciliation spawn workers with zero jitter since they're one-at-a-time. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>


+20 -5
2 changed files