Shopify

Adventures in Garbage Collection: Improving GC Performance in our Massive Monolith - Shopify

Apr 6, 2023
Adventures in Garbage Collection: Improving GC Performance in our Massive Monolith - Shopify
SummaryAI, from the source post

This post details specific tuning of Ruby's garbage collector to reduce latency in Shopify's monolith. It addresses major GC triggers like `:oldmalloc` by setting a high limit and `:nofree` by implementing finely-grained preallocation of heap slots using a custom hack and later a Ruby feature. The work involved extensive logging, metric analysis, hypothesis formation, and experimentation, leading to significant reductions in GC time and improved tail latency.

More from the Ruby Execution Models and Threading trail