Skip to content

Tune Ruby's GC params for faster `sup`

rvnd edited this page Jun 19, 2014 · 1 revision

Sup was kind of slow, and sometimes took a few seconds to open up an (albeit large) email thread. Running perftools.rb on it to see what was taking up so much time, shows that surprisingly ~ 60% of wallclock time is spent in GC.

Tuning Ruby's GC not to run so often fixed this, resulting in GC now taking only 13% of wall clock time, as well as a faster sup. The settings I used are:

  export RUBY_GC_MALLOC_LIMIT=256000000
  export RUBY_HEAP_MIN_SLOTS=600000
  export RUBY_HEAP_SLOTS_INCREMENT=200000
  export RUBY_HEAP_FREE_MIN=100000
Clone this wiki locally