I have Ruby 2.1.5 installed on my server and need to configure GC tuning variables for the best/optimum Ruby performance.
Following is the hardware/software information information:
Based on this link (http://tmm1.net/ruby21-rgengc/), i found around ~ 476K long lived objects (using GC.stat(:heap_live_slot)), and so i allocated
RUBY_GC_HEAP_INIT_SLOTS=500000
But what about the rest of the variables (mentioned below). What should be appropriate values for these variables ? What more (and how) should i analyze in my environment / server to find appropriate values for these variables ?
RUBY_GC_HEAP_FREE_SLOTS=?
RUBY_GC_HEAP_GROWTH_FACTOR=?
RUBY_GC_HEAP_GROWTH_MAX_SLOTS=?
RUBY_GC_MALLOC_LIMIT=?
RUBY_GC_MALLOC_LIMIT_MAX=?
RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR=?
RUBY_GC_OLDMALLOC_LIMIT=?
RUBY_GC_OLDMALLOC_LIMIT_MAX=?
RUBY_GC_OLDMALLOC_LIMIT_GROWTH_FACTOR=?
RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=?
If any other information is required, let me know !
How do I assign those values?
Through env variables e.g.:
RAILS_ENV=production RUBY_GC_MALLOC_LIMIT=90000000 bundle exec thin start
export RUBY_GC_MALLOC_LIMIT=90000000
...
(If I'm misunderstanding the question and you actually mean "What could I assign those values?" Have a loook here and here.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With