From 783d197e7e865ed900f8caa5edc9d790b62652a5 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Tue, 10 Sep 2013 11:56:59 +0200 Subject: [PATCH] Tune GC for unicorn --- config/unicorn.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/unicorn.rb b/config/unicorn.rb index be3065d1..1e9da525 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -9,3 +9,11 @@ require 'fileutils' before_fork do |server,worker| FileUtils.touch('/tmp/app-initialized') end + +before_exec do |server| + ENV['RUBY_HEAP_MIN_SLOTS']=800000 + ENV['RUBY_GC_MALLOC_LIMIT']=59000000 + ENV['RUBY_HEAP_SLOTS_INCREMENT']=10000 + ENV['RUBY_HEAP_SLOTS_GROWTH_FACTOR']=1 + ENV['RUBY_HEAP_FREE_MIN']=100000 +end