From 60284d8a9a99b549ff415c3596568f878ad8f6a8 Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 13 Oct 2013 08:06:45 +1100 Subject: [PATCH] add custom clean env --- script/bench.rb | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/script/bench.rb b/script/bench.rb index 208db4f90..dc246270f 100644 --- a/script/bench.rb +++ b/script/bench.rb @@ -59,12 +59,22 @@ unless File.exists?("config/redis.yml") `cp config/redis.yml.sample config/redis.yml` end -# Github settings ENV["RAILS_ENV"] = "profile" -ENV["RUBY_GC_MALLOC_LIMIT"] = "1000000000" -ENV["RUBY_HEAP_SLOTS_GROWTH_FACTOR"] = "1.25" -ENV["RUBY_HEAP_MIN_SLOTS"] = "800000" -ENV["RUBY_FREE_MIN"] = "600000" + +if ARGV.include?("--noenv") + puts "Running with default environment" + ENV.delete "RUBY_GC_MALLOC_LIMIT" + ENV.delete "RUBY_HEAP_SLOTS_GROWTH_FACTOR" + ENV.delete "RUBY_HEAP_MIN_SLOTS" + ENV.delete "RUBY_FREE_MIN" +else + # Github settings + puts "Running with tuned environment" + ENV["RUBY_GC_MALLOC_LIMIT"] = "1000000000" + ENV["RUBY_HEAP_SLOTS_GROWTH_FACTOR"] = "1.25" + ENV["RUBY_HEAP_MIN_SLOTS"] = "800000" + ENV["RUBY_FREE_MIN"] = "600000" +end def port_available? port server = TCPServer.open("0.0.0.0", port)