Skip to main content
← PROBLEMS / SYSTEM-DESIGN
An end-to-end domain learning journey

Mitigating TLS Handshake
Storms on Reconnects.

A simultaneous ingress/ALB rotation drops 120,000 mTLS connections; without shared TLS 1.3 session ticket keys or jittered reconnects, 60,000 full ECDHE + RSA-2048 handshakes/sec pin CPU at 100%.
Start the journey5 stages
FIRST PRINCIPLES. PRODUCTION SCALE.
The idea to keep with you

To keep the architecture evolvable without sacrificing reliability, enable TLS 1.3 PSK session resumption with rotated shared STEKs, switch leaf certs from RSA-2048 to ECDSA P-256, and stagger reconnects with jitter + handshake rate limits.

TL;DR30-second simplified summary
▾

Core Mechanics: An Envoy ingress fleet (40 pods × 4 vCPU = 160 vCPU) terminates 120,000 persistent mTLS/TLS 1.3 connections from 1,500 pods.

Visual & Structural Flow: Depicts 60k/sec Asymmetric Storm vs. Shared-STEK 1-RTT PSK (1,500 Client Pods -> NLB / Reload -> Envoy (40 Pods) -> Shared STEK); Shared STEK Ring + ECDSA P-256 + Client Jitter (1,500 Pods (Jitter) -> Envoy Fleet (40x) -> SDS Secret Store -> Kernel Backlog).

Trade-Offs & Production: Using default per-pod random STEKs (Session Ticket Encryption Keys) behind a load balancer causes 39/40 pods to reject a client's session ticket and fall back to a full handshake. Slash both per-handshake CPU cost and simultaneous reconnect rate: Shared STEK Rotation (<= 12h): Distribute identical TLS 1.3 session ticket keys across all 40 Envoy pods via.

Failure Modes & Application: TLS handshake resilience is critical in zero-trust service meshes and edge gateways: Envoy / Istio Service Meshes: Protects ingress and sidecar proxies during rolling deploys or NLB target shifts.

Full walkthrough · 5 stages
01
STAGE 01 · WHY IT MATTERSL4 · FUNDAMENTALS

Why TLS Handshake Storm Mitigation Matters.

Why this matters: The mechanism: understand how Why TLS Handshake Storm Mitigation Matters works from first principles.

An Envoy ingress fleet (40 pods × 4 vCPU = 160 vCPU) terminates 120,000 persistent mTLS/TLS 1.3 connections from 1,500 pods.

When an NLB or Envoy EDS/CDS reload resets connections, all 1,500 pods reconnect at 60,000 handshakes/sec.

02
STAGE 02 · IMPACTL5 · APPLIED DESIGN

Real-World Impact of Asymmetric Handshake Storms.

Why this matters: The problem: see what breaks without Real-World Impact of Asymmetric Handshake Storms under real concurrency or scale.

Full TLS handshakes are orders of magnitude more expensive than symmetric record encryption:

  1. 100% CPU Saturation: RSA-2048 signing takes ~1–2 ms CPU per handshake; 60,000/sec exceeds 160 vCPU capacity.
  2. SYN Queue Overflow: Delayed accept() fills kernel somaxconn, dropping new connections and triggering retries.
  3. Cascading Mesh Timeout: Healthy requests queue behind stalled TLS handshakes, tripping circuit breakers sitewide.
TLS 1.3 Full Handshake vs. PSK Resumption

60k/sec Asymmetric Storm vs. Shared-STEK 1-RTT PSK

1,500 Client PodsNLB / ReloadEnvoy (40 Pods)Shared STEK1. 120k conns reset simultaneously2. Naive: 60k/s full RSAhandshakes -> 100% CPU3. Fixed: Jittered reconnect + TLS1.3 PSK4. Decrypt ticket via shared STEK(symmetric)5. Resume in 1-RTT (<5% CPUoverhead)

Shared STEK session resumption + ECDSA P-256 certs + client reconnect jitter cut handshake CPU by >90%.

Engineering Decision Framework
Problem
How to implement Mitigating TLS Handshake Storms on Reconnects without hitting unbounded tail latency, state divergence, or operational fragility.
Naive Solution
Use a single unpartitioned path with unbounded retries and synchronous global coordination.
Why It Fails
Global coordination serializes throughput under load, while unbounded retries amplify transient stalls into full outages.
Alternatives
Compare synchronous strict-consistency paths against bounded asynchronous replication, local caching, or partitioned ownership.
Engineering Decision
To keep the architecture evolvable without sacrificing reliability, enable TLS 1.3 PSK session resumption with rotated shared STEKs, switch leaf certs from RSA-2048 to ECDSA P-256, and stagger reconnects with jitter + handshake rate limits.
Trade-Offs
Gains predictable p99 latency and fault isolation in exchange for explicit bounding, observability, and slightly higher implementation complexity.
Decision Exercise · Make the Call

When Mitigating TLS Handshake Storms on Reconnects experiences a sudden 5x traffic spike alongside a slow downstream dependency, which engineering choice best protects system stability?

03
STAGE 03 · NAIVE SOLUTIONL5 · APPLIED DESIGN

Naive Solution (and Why It Breaks).

Why this matters: The problem: see what breaks without Naive Solution under real concurrency or scale.

Think of Naive Solution (and Why It Breaks) as the intuition layer for Mitigating TLS Handshake Storms on Reconnects: The problem: see what breaks without Naive Solution under real concurrency or scale.

Using default per-pod random STEKs (Session Ticket Encryption Keys) behind a load balancer causes 39/40 pods to reject a client's session ticket and fall back to a full handshake. Disabling mTLS violates zero-trust policy, and keeping RSA-2048 certs burns ~5–8x more server signing CPU than ECDSA P-256.

Component Topology

Naive Solution (and Why It Breaks)

ClientingressEdge GatewaycomputeJWKS / VaultstorageTarget ServicecontrolBearer / mTLSkey lookupscoped call
04
STAGE 04 · ENTERPRISE SOLUTIONL6 · SCALE & TRADE-OFFS

Enterprise Solution: Shared Rotating STEKs, ECDSA P-256 & Jittered Reconnects.

Why this matters: Operational control: configure bounds, failure handling, and safe production defaults.

Slash both per-handshake CPU cost and simultaneous reconnect rate:

  • Shared STEK Rotation (<= 12h): Distribute identical TLS 1.3 session ticket keys across all 40 Envoy pods via SDS/Secrets Manager (keeping current + previous key for seamless 12-hour rotation) so PSK resumption succeeds on any pod.
  • Switch RSA-2048 to ECDSA P-256: Cuts server-side CertificateVerify signing CPU by ~5–8x on full handshakes.
  • Reconnect Jitter & Handshake Rate Limiting: Configure clients with randomized connection max-age + exponential jitter so 120k sockets never drop at once, and enable Envoy listener_filters / admission rate limits to protect CPU.
Fleet-Wide TLS Resumption

Shared STEK Ring + ECDSA P-256 + Client Jitter

1,500 Pods (Jitter)Staggered reconnectsEnvoy Fleet (40x)TLS 1.3 PSK + ECDSA…SDS Secret StoreShared STEK (12h rot)Kernel Backlogsomaxconn >= 4096Key[curr, prev]

1.Shared STEKs: Any of the 40 Envoy pods can decrypt a client's PSK session ticket.

2.ECDSA P-256: 5-8x faster server signing than RSA-2048 on cache misses.

3.Max-Age Jitter: Randomizing connection lifetime prevents synchronized herd reconnects.

4.Forward Secrecy: 12-hour STEK rotation with [curr, prev] overlap preserves PFS.

Shared rotating STEKs and ECDSA P-256 allow 40 Envoy pods to absorb reconnects without CPU saturation.

common_http_protocol_options:
  max_connection_duration: 300s
  # Client-side jittered reconnect prevents synchronized 300s drops

overload_manager:
  refresh_interval: 0.25s
  resource_monitors:
    - name: envoy.resource_monitors.fixed_heap
      typed_config: { max_heap_size_bytes: 2147483648 }
openssl s_client -connect ingress-pod-a:443 -tls1_3 -sess_out /tmp/sess.pem </dev/null
openssl s_client -connect ingress-pod-b:443 -tls1_3 -sess_in /tmp/sess.pem </dev/null | grep Reused
05
STAGE 05 · SYSTEM DESIGN APPLICATIONSL7 · STAFF / PRINCIPAL

Where TLS Storm Mitigation Applies in System Design.

Why this matters: Scope boundary: identify where this pattern fits best and where simpler or async alternatives win.

TLS handshake resilience is critical in zero-trust service meshes and edge gateways:

  • Envoy / Istio Service Meshes: Protects ingress and sidecar proxies during rolling deploys or NLB target shifts.
  • CDN & Edge PoPs: Shared session-ticket key distribution across regional PoPs.
  • IoT & Mobile Backends: Prevents mass-reconnect thundering herds after cell-tower or DNS failovers.
Practice · Explain the consequences

Practice: Make the trade-off yourself.

Question 1 of 3
Score: 0/3

Why do TLS session tickets fail to prevent a CPU storm behind a 40-pod Envoy load balancer if each pod generates its own random STEK?

Recommended Learning Flow