diff --git a/config/unicorn.rb b/config/unicorn.rb index a3daec0..4e5c8d1 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -4,7 +4,10 @@ rails_root = `pwd`.gsub("\n", "") rails_env = ENV['RAILS_ENV'] || 'production' -worker_processes (rails_env == 'production' ? 4 : 2) + +cpu_cores = %x(cat /proc/cpuinfo | grep processor | wc -l).sub("\n",'').to_i rescue 2 + +worker_processes (rails_env == 'production' ? cpu_cores : 1) # preload_app true