Upgrade to puma 3.1.

This commit is contained in:
Martin Edenhofer 2016-03-17 11:58:42 +01:00
parent a2b0fe69b9
commit 3fcc206306
6 changed files with 23 additions and 12 deletions

View file

@ -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')

View file

@ -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

10
config/puma.rb Normal file
View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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