Tweaking Ruby GC Parameters for Fun, Speed, and Profit
summary
Upgrading and tuning Ruby GC actually changes measurable behavior: compiled Ruby from source, exported GC environment variables and deployed tuned heap_init_slots, malloc_limit values, and measures with New Relic and ab. Garbage-collection frequency drops (example 80→40 GC runs), object allocation differs massively between environments (13,000 vs 94,000 objects), and time spent in GC and web latency fall by milliseconds to low-double-digit percent gains. Tests use staged data to reproduce production GC pressure and iterate change → measure → analyze.
AI-written summary · about
chapters (14)
- 0:00Intro
- 3:14Why I am here... GC
- 5:44A brief history about Ruby GC
- 7:28Ruby 1.8: Simple Mark & Sweep
- 8:10Ruby 2.0: Bitmap Masking (Cow)
- 10:40GC Parameters: ruby 2.0.X
- 11:20GC Parameters: Ruby = 2.1.X
- 15:09Me: measuring & tuning
- 22:48Change, Measure & Analyze
- 27:55Ruby 2.0.0 vs Ruby 2.1.7
- 30:14Ruby 2.1.7 before vs after
- 31:25Ruby 2.2.3 before vs after
- 32:32Ruby 2.1.7 vs 2.2.3 (after)
- 37:21Some of my findings
related talks
33mRails and the Ruby Garbage Collector: How to Speed Up Your Rails App
21mUnderstanding Garbage Collection in Ruby
38mWhy I am excited about Ruby 2.1?
35mThe Hitchhiker's Guide to Ruby GC
34mUnder the Hood of Ruby's Generational Garbage Collector
49mRabbit Hole: Garbage Collection and Ruby's Future
30mBuilding the Next-Generation Garbage Collector in Ruby
24mRuby Performance Secrets and How to Uncover Them
