From ee5f35d4e94e70a51bfd5f355d1c0e9a3c427fc6 Mon Sep 17 00:00:00 2001 From: Cassius Chen Date: Thu, 21 Nov 2013 23:00:14 +0800 Subject: [PATCH] Update puma.rb --- config/puma.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/puma.rb b/config/puma.rb index 8d879ab5c46..d14ae5dd6ca 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,8 +1,9 @@ # First, you need to change these below to your situation. APP_ROOT = '/home/discourse/discourse' +num_worker=ENV["NUM_WEBS"].to_i > 0 ? ENV["NUM_WEBS"].to_i : 4 # Second, you can choose how many threads that you are going to run at same time. -workers 4 +workers "#{num_workers}" threads 8,32 # Unless you know what you are changing, do not change them. @@ -11,4 +12,4 @@ stdout_redirect "#{APP_ROOT}/log/puma.log","#{APP_ROOT}/log/puma.err.log" pidfile "#{APP_ROOT}/tmp/pids/puma.pid" state_path "#{APP_ROOT}/tmp/pids/puma.state" daemonize true -preload_app! \ No newline at end of file +preload_app!