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:
- Memory - 7697604 KB (8GB)
- CPU - Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz (2 Cores)
- Ruby - 2.1.5
- Rails - 3.2.18
- Passenger - 4.0.27
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 !