Skip to content

Commit

Permalink
switch webbrick to puma
Browse files Browse the repository at this point in the history
  • Loading branch information
dmacvicar committed Oct 20, 2017
1 parent d79b45a commit dd9dffa
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ end

group :production do
gem 'mysql2', '~> 0.4.9'
gem 'puma'
end

group :test do
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ GEM
websocket-driver (>= 0.2.0)
powerpack (0.1.1)
public_suffix (3.0.0)
puma (3.10.0)
rack (1.6.8)
rack-test (0.6.3)
rack (>= 1.0)
Expand Down Expand Up @@ -210,6 +211,7 @@ DEPENDENCIES
mysql2 (~> 0.4.9)
nokogiri
poltergeist
puma
rails (~> 4.2.8)
rails-i18n
rubocop (>= 0.47)
Expand Down
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['RAILS_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 dd9dffa

Please sign in to comment.