Skip to content

Add proxy concurrency post: ATS, HAProxy, Envoy architecture#38

Merged
singhsanjay12 merged 16 commits intomainfrom
ssingh1/proxy-concurrency-post
Mar 10, 2026
Merged

Add proxy concurrency post: ATS, HAProxy, Envoy architecture#38
singhsanjay12 merged 16 commits intomainfrom
ssingh1/proxy-concurrency-post

Conversation

@singhsanjay12
Copy link
Copy Markdown
Owner

Summary

  • New post: How Reverse Proxies Handle Concurrent Connections at Scale (ATS, HAProxy, Envoy)
  • Covers the thin layer constraint, C10K problem, event loop model
  • Deep dives on ATS continuation system, HAProxy nbthread/SO_REUSEPORT, Envoy thread-per-core isolation
  • Robustness section: graceful restart, circuit breaking, connection draining
  • 5 SVG diagrams: hero, thread-models, ats-arch, haproxy-arch, envoy-arch
  • All diagrams improved: proper arrow markers, consistent arc loop icons, NO SHARED STATE barriers, load bars, xDS control plane annotations

Testing Done

  • ruby tests/svg_test.rb — 8 runs, 965 assertions, 0 failures
  • All SVGs validate against test constraints (width=800, gradient IDs, caption format, TEXT_BOTTOM_LIMIT=385)

singhsanjay12 and others added 16 commits March 9, 2026 18:15
New post covering how reverse proxies handle concurrent connections at
scale: the thin layer constraint, event loop model, and the concurrency
architecture of Apache Traffic Server (continuation system), HAProxy
(single-process nbthread), and Envoy (thread-per-core isolation).

Includes 5 SVG diagrams: hero, thread-models comparison, ATS event
thread architecture, HAProxy process model, and Envoy worker isolation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- thread-models.svg: bold VS divider, proper arrow markers, larger event
  loop box with arc icon centered, clean fan-in lines from connection dots
- ats-arch.svg: bezier dispatch curves with arrowheads, compact ET_NET
  column with arc icons, continuation model panel with plugin warning
- haproxy-arch.svg: fixed epoll arc+arrowhead icons, SO_REUSEPORT dispatch
  arrows, hot-reload callout, shared-state annotation inside process box
- envoy-arch.svg: 2×2 worker grid with isolated badges, bold NO SHARED
  STATE barriers with pill labels, xDS arrows from control plane box
- hero.svg: column separators, arrow markers, load bars on backends,
  arc loop icon and ~10K badge in proxy box

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Always verify singhsanjay12 is the active gh account before creating PRs —
ssingh1_LinkedIn (Enterprise Managed User) cannot create PRs on this repo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ribute

Duplicate XML attributes are invalid and prevent SVG parsing entirely.
Merged into a single font-family value.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tests/svg_test.rb: new test_no_duplicate_attributes scans every opening
tag for repeated attribute names — the class of bug that silently broke
haproxy-arch.svg and envoy-arch.svg (two font-family= on one element).

envoy-arch.svg: same copy-paste duplicate font-family= fixed, caught
immediately by the new test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds {: file="haproxy.cfg" } and nginx syntax highlighting to the
configuration snippet so it renders as a named code box in the theme.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The blog disables Rouge (syntax_highlighter: disable: true), so Chirpy's
{: file="..." } IAL and language specifiers do not produce styled output —
they only added broken attributes to <pre>. Replaced with a custom HTML
block: dark #1e293b background, file icon + label header, monospace code,
and greyed-out inline comments. Renders correctly regardless of theme processing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two Python examples illustrate the concurrency model contrast:
- Thread model: recv() blocks the OS thread; 10k clients = 10k threads
- Event loop: await yields control; one thread serves thousands

Both use the same dark HTML code box as the HAProxy config snippet,
with keywords, literals, and comments lightly syntax-coloured.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three issues fixed:
- Dispatch arrows to W2 and W3 were passing through W0 and W1 boxes.
  W2 arrow now routes above the grid (y=16), W3 routes below (y=320),
  so both arc cleanly around the outside without crossing any box.
- Horizontal NO SHARED STATE barrier was at y=162, inside W0/W2
  (which end at y=165). Moved W1/W3 down to y=175, creating a proper
  10px gap; barrier now sits at y=170 between the rows.
- xDS second arrow was a raw diagonal line. Replaced both xDS arrows
  with smooth curves routing from xDS box bottom to each worker's
  right-centre edge.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the 2×2 grid with a vertical stack of 4 workers so dispatch
arrows can fan out cleanly from the listener through a dedicated 76-px
lane (x=254–328) without any crossing. Key changes:

- Workers now stacked vertically (W0–W3, each 190×62 px, 16-px gaps)
- Listener Thread centred vertically alongside the worker column (y=167)
- Dispatch S-curves all confined to x=254–328, control points at x=292
- xDS arrows confined to x=520–580, control points at x=555
- Three horizontal NO SHARED STATE barriers (y=90, 168, 246); centre
  barrier is labelled with the red pill
- All text baselines ≤385 px (within viewBox bounds); passes SVG tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Link section headers to official docs: Apache Traffic Server,
  HAProxy, Envoy
- Link body terms: Apache HTTPd, C10K problem, epoll, kqueue,
  TSAPI plugin interface, libevent, xDS protocol, Istio
- Add HAProxy User Spotlight talk at the bottom:
  Modernizing LinkedIn's Traffic Stack

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two issues fixed:

1. Arc loop icon inside the event loop box was r=16 (~50px wide), whose
   right side extended into the text label zone. Text like "socket
   becomes readable" (centred at x=635, left edge ~x=574) overlapped
   the arc polygon (x≤579). Fix: shrink arc to r=10, reposition to
   top-left corner (x≈548-569, y≈118-133), shift all box text and
   badge from centre x=635 to x=648, giving ≥15 px clearance.

2. "idle" label (x=455, y=173, light-grey fill) sat directly on a
   fan-in line that passes through (455, ~175) in the same grey tone,
   making the label invisible. Fix: add opaque white background rect
   and darken label fill from #94a3b8 to #64748b.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- thread-models.svg: move '⋯ thousands' label above the green
  annotation box (y=303→289) so it is not covered
- hero.svg: right-align backend load labels ('3 req', '5 req', 'idle')
  at x=775 with text-anchor=end so they don't bleed into the box border
- ats-arch.svg: expand ET_NET 2 box height 52→64 and split the long
  sublabel into two lines; reposition arc icon and dispatch arrow to
  match the new box centre

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
test_em_dash_count_in_post_sources caps em dashes at 3; the post had
32. Replaced all prose em dashes with colons, semicolons, commas, or
parentheses as appropriate. Also updated code-label spans and inline
code comments (thread-per-connection · Python, yields; other ...).
Front-matter description is exempt from the check so its em dash is
left as-is.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Move conn dots from cy=192 to cy=206 so they sit on a distinct row
  below the title instead of overlapping 'ET_NET 2 ⚠ overloaded'
- Shift sublabel text down (y=210/223 → y=219/231) to match the new
  row spacing in the taller 64px box
- Fix orange annotation line: extend from x=557→555 (box right edge)
  and x=578→580 (callout box left edge) to eliminate the floating gap
- Add indigo pill background behind 'round-robin' label so it reads
  clearly over the crossing dispatch curves

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@singhsanjay12 singhsanjay12 merged commit 4a7d2ec into main Mar 10, 2026
1 check passed
@singhsanjay12 singhsanjay12 deleted the ssingh1/proxy-concurrency-post branch March 10, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant