Skip to content

Commit

Permalink
use puma instead of thin
Browse files Browse the repository at this point in the history
  • Loading branch information
tjgrathwell committed Aug 24, 2015
1 parent 2a55f7d commit 0cd2b47
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ gem 'dotenv-rails', groups: [:development, :test]

gem 'rails', '4.2.3'
gem 'devise', '~> 3.5.0'
gem 'thin'
gem 'puma'
gem 'jquery-rails'
gem 'nested_form'
gem 'select2-rails'
Expand Down
9 changes: 2 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ GEM
crack (0.4.2)
safe_yaml (~> 1.0.0)
crass (1.0.2)
daemons (1.2.3)
debug_inspector (0.0.2)
devise (3.5.2)
bcrypt (~> 3.0)
Expand All @@ -125,7 +124,6 @@ GEM
eco-source (1.1.0.rc.1)
ejs (1.1.1)
erubis (2.7.0)
eventmachine (1.0.8)
excon (0.45.4)
execjs (2.6.0)
factory_girl (4.5.0)
Expand Down Expand Up @@ -240,6 +238,7 @@ GEM
cliver (~> 0.3.1)
multi_json (~> 1.0)
websocket-driver (>= 0.2.0)
puma (2.13.4)
quiet_assets (1.1.0)
railties (>= 3.1, < 5.0)
rack (1.6.4)
Expand Down Expand Up @@ -337,10 +336,6 @@ GEM
sqlite3 (1.3.10)
test_after_commit (0.4.1)
activerecord (>= 3.2)
thin (1.6.3)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0)
rack (~> 1.0)
thor (0.19.1)
thread_safe (0.3.5)
tilt (1.4.1)
Expand Down Expand Up @@ -404,6 +399,7 @@ DEPENDENCIES
omniauth-twitter
pg
poltergeist
puma
quiet_assets
rack-canonical-host
rails (= 4.2.3)
Expand All @@ -420,7 +416,6 @@ DEPENDENCIES
simple_form
sqlite3
test_after_commit
thin
uglifier
webmock

Expand Down
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: rails server thin -p $PORT -e $RACK_ENV
web: bundle exec puma -C config/puma.rb
6 changes: 2 additions & 4 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,5 @@ test:
timeout: 5000

production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
url: <%= ENV["DATABASE_URL"] %>
pool: <%= ENV["DB_POOL"] || ENV['MAX_THREADS'] || 5 %>
15 changes: 15 additions & 0 deletions config/puma.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
workers Integer(ENV['WEB_CONCURRENCY'] || 2)
threads_count = Integer(ENV['MAX_THREADS'] || 5)
threads threads_count, threads_count

preload_app!

rackup DefaultRackup
port ENV['PORT'] || 3000
environment ENV['RACK_ENV'] || 'development'

on_worker_boot do
# Worker specific setup for Rails 4.1+
# See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
ActiveRecord::Base.establish_connection
end

0 comments on commit 0cd2b47

Please sign in to comment.