~/talk

connect() - why you so slow?!

Talkat Linux Plumbers Conference 2023 · 2023-11-13..11-15· [networking]
links:none on file
slides:none on file

Opening ~50k connections to one origin makes connect() latency bimodal and wildly slow: experiments and flamegraphs show the inet_hash_connect loop plus parity (even/odd) port walking causes massive looping and lock contention, yielding ~279 connects/sec and exhaustion taking minutes. Cloudflare uses the work stress tool, flamegraphs, BPF tracing and a Prometheus eBPF exporter to profile. User-space fixes include bind-before-connect with random picks and the IP_LOCAL_PORT_RANGE socket option with 1K port windows and random offsets, dropping exhaustion from ~3 minutes to ~9 seconds.

AI-written summary · about

  1. 0:00Introduction
  2. 0:43Cloudflare connection challenges
  3. 7:27inet_hash_connect algorithm
  4. 12:28Looping problem analysis
  5. 16:00User space solutions
  6. 20:35Local port range optimization
  7. 21:39Kernel policy discussion
  8. 22:24Q&A session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.