diff --git a/Gemfile b/Gemfile index 3e7cf4d9a..ecc9a8afd 100644 --- a/Gemfile +++ b/Gemfile @@ -122,7 +122,7 @@ group :development, :test do end -gem 'puma', '< 3.0' +gem 'puma' # load onw gem's local_gemfile = File.join(File.dirname(__FILE__), 'Gemfile.local') diff --git a/Gemfile.lock b/Gemfile.lock index 4918796e1..d51b0aba6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -90,7 +90,7 @@ GEM dnsruby (>= 1.5) equalizer (0.0.10) erubis (2.7.0) - eventmachine (1.2.0) + eventmachine (1.2.0.1) execjs (2.6.0) faraday (0.9.2) multipart-post (>= 1.2, < 3) @@ -199,7 +199,7 @@ GEM coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) - puma (2.16.0) + puma (3.1.0) rack (1.6.4) rack-livereload (0.3.16) rack @@ -253,9 +253,8 @@ GEM sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) scrub_rb (1.0.1) - selenium-webdriver (2.52.0) + selenium-webdriver (2.53.0) childprocess (~> 0.5) - multi_json (~> 1.0) rubyzip (~> 1.0) websocket (~> 1.0) shellany (0.0.1) @@ -352,7 +351,7 @@ DEPENDENCIES omniauth-linkedin omniauth-twitter pre-commit - puma (< 3.0) + puma rack-livereload rails (= 4.2.6) rails-observers diff --git a/config/puma.rb b/config/puma.rb new file mode 100644 index 000000000..b01ec9be7 --- /dev/null +++ b/config/puma.rb @@ -0,0 +1,10 @@ +workers Integer(ENV['WEB_CONCURRENCY'] || 2) +threads_count_min = Integer(ENV['MIN_THREADS'] || 5) +threads_count_max = Integer(ENV['MAX_THREADS'] || 20) +threads threads_count_min, threads_count_max + +preload_app! + +on_worker_boot do + ActiveRecord::Base.establish_connection +end diff --git a/script/build/test_startup.sh b/script/build/test_startup.sh index 825c9c207..f12d731df 100755 --- a/script/build/test_startup.sh +++ b/script/build/test_startup.sh @@ -16,6 +16,6 @@ echo "export IP=$IP" echo "export BROWSER_PORT=$BROWSER_PORT" #rails s puma -d --pid tmp/pids/server.pid --bind 0.0.0.0 --port $APP_PORT -pumactl start --pidfile tmp/pids/server.pid -d -p $APP_PORT -e $RAILS_ENV +puma --pidfile tmp/pids/server.pid -d -p $APP_PORT -e $RAILS_ENV script/websocket-server.rb start -d -p $WS_PORT script/scheduler.rb start diff --git a/script/init-script-normal-user-rvm-fedora b/script/init-script-normal-user-rvm-fedora index 3358e06d2..e8f5eebf9 100755 --- a/script/init-script-normal-user-rvm-fedora +++ b/script/init-script-normal-user-rvm-fedora @@ -63,7 +63,7 @@ start() { echo -n $"Starting ${NAME}/${RAILS_ENV} application server on port: ${APP_PORT}" # $RAILS server -d -p $APP_PORT --pid $APP_PIDFILE &> /dev/null # thin start --threaded -d -p $APP_PORT --pid $APP_PIDFILE - pumactl start --pidfile $APP_PIDFILE -d -p $APP_PORT -e $RAILS_ENV &> /dev/null + puma --pidfile $APP_PIDFILE -d -p $APP_PORT -e $RAILS_ENV &> /dev/null sleep 2 status -p $APP_PIDFILE &> /dev/null && echo_success || echo_failure echo diff --git a/script/local_browser_tests.sh b/script/local_browser_tests.sh index 35bbca3ea..9900a72c7 100755 --- a/script/local_browser_tests.sh +++ b/script/local_browser_tests.sh @@ -38,16 +38,18 @@ rails r "Setting.set('developer_mode', true)" pumactl --pidfile tmp/pids/puma.pid stop script/websocket-server.rb stop -pumactl start --pidfile tmp/pids/puma.pid -d -p 4445 -e $RAILS_ENV +rails s puma -d --pid tmp/pids/puma.pid --bind 0.0.0.0 --port 4445 script/websocket-server.rb start -d script/scheduler.rb start -sleep 15 +sleep 10 #export REMOTE_URL='http://medenhofer:765d0dd4-994b-4e15-9f89-13f3aedeb462@ondemand.saucelabs.com:80/wd/hub' BROWSER_OS='Windows 2012' BROWSER_VERSION=35 BROWSER=firefox #export REMOTE_URL='http://192.168.178.32:4444/wd/hub' #export REMOTE_URL='http://192.168.178.45:4444/wd/hub' -export REMOTE_URL='http://10.0.0.9:4444/wd/hub' +#export REMOTE_URL='http://10.0.0.9:4444/wd/hub' +#export REMOTE_URL='http://10.8.0.22:4449/wd/hub' +export REMOTE_URL='http://localhost:4444/wd/hub' export RAILS_ENV=test @@ -58,10 +60,10 @@ time rake db:create echo "rake db:migrate" time rake db:migrate +#rake test:browser["BROWSER_URL=http://10.8.0.6:3000"] rake test:browser["BROWSER_URL=http://localhost:4445"] #rake test:browser["BROWSER_URL=http://10.0.0.3:4445"] #rake test:browser["BROWSER_URL=http://localhost:4445 BROWSER=chrome"] -#rake test:browser["BROWSER_URL=http://192.168.178.28:4445"] script/scheduler.rb stop script/websocket-server.rb stop