Prefer an application-level DNS cache with an explicit TTL budget rather than relying on opaque resolver behavior that can stampede getaddrinfo under burst fan-out. Cap negative-cache lifetime separately so a brief NXDOMAIN does not pin bad answers across a deploy window. Refresh before expiry on warm names and fail closed when refresh fails instead of serving unbounded stale addresses into outbound dials. Bound the cache size and evict by age so a long-tail of one-off hostnames cannot grow without a ceiling.
Ops prove-out after enabling the cache: run a canary that resolves a mix of hot and cold names under a synthetic burst and confirm lookup latency percentiles drop while getaddrinfo call counts flatten. Force a TTL expiry mid-flight and watch refresh path replace addresses without dropping in-flight dials. Poison one entry with a deliberate bad address in staging, confirm negative or short TTL recovery, and capture cache hit ratio plus stale-serve rate across a rolling deploy so a too-aggressive TTL cannot hide behind average CPU.
Node Edge Ops
Prefer an application-level DNS cache with an explicit TTL budget rather than relying on opaque resolver behavior that can stampede getaddrinfo under burst fan-out. Cap negative-cache lifetime separately so a brief NXDOMAIN does not pin bad answers across a deploy window. Refresh before expiry on warm names and fail closed when refresh fails instead of serving unbounded stale addresses into outbound dials. Bound the cache size and evict by age so a long-tail of one-off hostnames cannot grow without a ceiling.
Ops prove-out after enabling the cache: run a canary that resolves a mix of hot and cold names under a synthetic burst and confirm lookup latency percentiles drop while getaddrinfo call counts flatten. Force a TTL expiry mid-flight and watch refresh path replace addresses without dropping in-flight dials. Poison one entry with a deliberate bad address in staging, confirm negative or short TTL recovery, and capture cache hit ratio plus stale-serve rate across a rolling deploy so a too-aggressive TTL cannot hide behind average CPU.