~/talk

What the fork()?

Talkat RailsConf 2021 · 2021-04-12..04-15· [ruby, web-performance]
links:none on file
slides:none on file

Explains how fork actually powers Spring and Puma: file descriptors travel via send_io / recv_io and are reopened with dup2, Puma balances workers by adding tiny sleeps between select and accept, and Spring preloads then forks to avoid reinitializing Rails. Recommends using posix_spawn or Process.spawn instead of manual fork+exec, running GC four times to be copy‑on‑write friendly (run GC 4 times before fork), measures with PSS, and shows a reduces memory usage up to 80% refork technique that succeeds in practice.

AI-written summary · about

  1. 0:00Start
  2. 8:43Optimizing fork(): vfork()
  3. 9:40Optimizing fork(): Copy-on-Write
  4. 10:52Beyond fork(): Threads
  5. 14:48fork in Ruby
  6. 17:00Spring process tree
  7. 26:51'Fork Server' tips
  8. 28:49Parallel processing tips
  9. 30:47Fork Safety
  10. 35:12Experiment #2: Puma Refork
~/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.