~/talk

Rails and the Ruby Garbage Collector: How to Speed Up Your Rails App

Talkat Rails World 2023 · 2023-10-05..10-06· [ruby-on-rails, ruby]
slides:none on file

Explains how Ruby’s mark‑and‑sweep, generational GC works, what to measure with GC.stat metrics, and which knobs actually change behavior like GC_HEAP_INIT_SLOTS and old malloc limits. Reports real results: tuning cuts average GC time per request ~50% and 99th GC time ~80%, translating to ~13% faster average responses (25% faster 99th). Introduces the Autotuner gem (github.com/shopify/autotuner) that analyzes between requests and emits concrete env var tuning suggestions.

AI-written summary · about

  1. 0:00Introduction to talk
  2. 0:25What is a garbage collector
  3. 1:29Ruby object memory structure
  4. 3:55How Ruby allocates objects
  5. 4:59Mark and sweep phases
  6. 8:29Generational garbage collection
  7. 10:13Major vs minor GC cycles
  8. 12:00Write barriers and remember set
  9. 14:52Sweeping phase explained
  10. 15:56Compaction in Ruby GC
  11. 17:20Collecting GC metrics
  12. 21:34Tuning the garbage collector
  13. 23:19Out-of-band garbage collection
  14. 25:11Real-world tuning results
  15. 26:17Ruby 3.3 GC improvements
  16. 28:41Introducing Autotuner gem
  17. 29:43Testing tuning at Shopify
  18. 32:08Q&A and closing
~/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.