Files
haproxy-manager-base/templates/hap_coraza_spoa_backend.tpl
T
shadowdaoandClaude Sonnet 5.5 06e5ad0ce7 edge: back-end health checks every 30s, staggered (default-server + spread-checks 50)
whp01 runs ~426 `check ssl` servers at the HAProxy default 2s interval:
~200+ TLS handshakes/s of pure health-check churn, which with memory
pressure preceded the 2026-11-25 watchdog aborts.

global:   spread-checks 50
defaults: default-server inter 30s fastinter 10s downinter 30s rise 2 fall 3

fastinter is 10s, not 2s: HAProxy spreads the first check of every server
over the smallest interval in use and a not-yet-fully-healthy server (every
server after a start/reload) uses fastinter, so 2s would put every reload's
first checks into a ~2s burst. Dead backend still marked down in <= ~65s.
The Coraza SPOA server keeps its own 2s checks. No change to the server
lines WHP supplies (check ssl verify none).

Tests: scripts/test-health-check-timing.py (in the image build) and
check-timing assertions in validate-rendered-config.py (real haproxy -c).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
2026-11-25 06:41:41 -08:00

17 lines
853 B
Smarty

# Coraza-SPOA backend.
# Only rendered into haproxy.cfg when HAPROXY_CORAZA_SPOE_BACKEND env var is
# set on the haproxy-manager container. SPOE traffic to this backend is TCP,
# not HTTP. The agent target comes from the env var so a single image can be
# deployed against different sidecar host:port pairs (typically the sidecar
# container's name + 9000 inside the shared docker network).
backend coraza-spoa-backend
mode tcp
# spop-check actually speaks the SPOE protocol against the agent —
# confirms the agent can negotiate a session, not just that the TCP
# port is open. Required to detect a half-broken SPOA that's listening
# but not actually processing.
option spop-check
timeout connect 5s
timeout server 30s
server coraza-spoa {{ agent_target }} check inter 2s fastinter 2s downinter 2s rise 2 fall 3