Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #101 from MITLibraries/puma
Browse files Browse the repository at this point in the history
Switch to Puma
  • Loading branch information
JPrevost committed Mar 18, 2016
2 parents 601e10b + fd49d8e commit 3e6ade7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ group :production do
end

group :production, :development do
gem 'passenger'
gem 'puma'
end

group :development, :test do
Expand Down
18 changes: 8 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ GEM
ansi (1.5.0)
arel (6.0.3)
ast (2.2.0)
aws-sdk (2.2.26)
aws-sdk-resources (= 2.2.26)
aws-sdk-core (2.2.26)
aws-sdk (2.2.28)
aws-sdk-resources (= 2.2.28)
aws-sdk-core (2.2.28)
jmespath (~> 1.0)
aws-sdk-resources (2.2.26)
aws-sdk-core (= 2.2.26)
aws-sdk-resources (2.2.28)
aws-sdk-core (= 2.2.28)
bcrypt (3.1.11)
bootstrap_form (2.3.0)
builder (3.2.2)
Expand Down Expand Up @@ -87,7 +87,7 @@ GEM
thread_safe (~> 0.1)
warden (~> 1.2.3)
docile (1.1.5)
domain_name (0.5.20160309)
domain_name (0.5.20160310)
unf (>= 0.0.5, < 1.0.0)
erubis (2.7.0)
execjs (2.6.0)
Expand Down Expand Up @@ -172,16 +172,14 @@ GEM
orm_adapter (0.5.0)
parser (2.3.0.6)
ast (~> 2.2)
passenger (5.0.26)
rack
rake (>= 0.8.1)
pg (0.18.4)
poltergeist (1.9.0)
capybara (~> 2.1)
cliver (~> 0.3.1)
multi_json (~> 1.0)
websocket-driver (>= 0.2.0)
powerpack (0.1.1)
puma (3.1.1)
rack (1.6.4)
rack-test (0.6.3)
rack (>= 1.0)
Expand Down Expand Up @@ -314,9 +312,9 @@ DEPENDENCIES
nokogiri
omniauth-mit-oauth2
omniauth-oauth2
passenger
pg
poltergeist
puma
rails (= 4.2.6)
rails_12factor
rest-client
Expand Down
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
web: bundle exec passenger start -p $PORT --max-pool-size 3
web: bundle exec puma -C config/puma.rb
worker: bundle exec rake jobs:work
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 3e6ade7

Please sign in to comment.