~/talk

How the Ruby Global VM Lock impacts app performance

Talkat RubyConf 2024 · 2024-11-13..11-15· [ruby]
slides:none on file

Ruby 3.2 adds a GVL instrumentation API and the gvl-tracing gem produces Perfetto timelines that show threads switching on a 100 ms quantum, revealing that adding a CPU-bound background thread turns a network test from ~17 requests/sec to ~2 requests/sec. Ractors give true parallelism but MN scheduling defaults to eight native threads so Ruby 3.3 maps many Ruby threads onto few OS threads. The experiments are reproducible, visual, and used to recommend separating latency‑sensitive work and starting Puma around 4 workers 5 threads.

AI-written summary · about

  1. 0:00Introduction
  2. 1:44What is the Ruby Global VM Lock
  3. 3:52Ruby threads to OS threads
  4. 5:16GVL vs GIL naming
  5. 6:20GVL allows concurrency not parallelism
  6. 7:23Why Ruby needs concurrency APIs
  7. 9:54Ruby implementations without GVL
  8. 10:15GVL tracing tools
  9. 11:16Reading GVL timelines
  10. 13:03Threads vs latency impact
  11. 14:49Ruby threads as noisy neighbors
  12. 16:14Network calls and GVL fairness
  13. 18:40GVL is not always fair
  14. 19:44Ractors and M:N scheduling
  15. 22:14Ruby threads and OS mapping
  16. 23:40Ruby 3.3 M:N scheduler
  17. 24:42Key insights from timelines
  18. 25:25Monitoring GVL with tools
  19. 26:07Practical recommendations
  20. 28:15Future of Ruby and GVL
~/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.