Skip to content

Commit

Permalink
Use puma instead of unicorn
Browse files Browse the repository at this point in the history
We have been using puma for all other apps on heroku and also this is default in new apps created by suspenders.
  • Loading branch information
arunagw authored and derekprior committed Jan 14, 2016
1 parent 7d858d2 commit 51312cf
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 40 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -34,6 +34,7 @@ gem "paperclip", "~> 4.2.2"
gem "pg"
gem "pg_search"
gem "pry-rails"
gem "puma"
gem "rack-canonical-host"
gem "rack-rewrite", "~> 1.5.1"
gem "rails", "~> 4.2.4"
Expand All @@ -49,7 +50,6 @@ gem "sprockets-redirect"
gem "stripe"
gem "stripe_event"
gem "uglifier"
gem "unicorn"
gem "validates_email_format_of"
gem "vanity", "2.0.0.beta8"
gem "wrapped"
Expand Down
9 changes: 2 additions & 7 deletions Gemfile.lock
Expand Up @@ -161,7 +161,6 @@ GEM
kaminari (0.16.3)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
kgio (2.9.2)
launchy (2.4.3)
addressable (~> 2.3)
loofah (2.0.3)
Expand Down Expand Up @@ -217,6 +216,7 @@ GEM
slop (~> 3.4)
pry-rails (0.3.2)
pry (>= 0.9.10)
puma (2.15.3)
quiet_assets (1.0.3)
railties (>= 3.1, < 5.0)
rack (1.6.4)
Expand Down Expand Up @@ -276,7 +276,6 @@ GEM
activesupport (= 4.2.5)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
raindrops (0.13.0)
rake (10.5.0)
recipient_interceptor (0.1.2)
mail
Expand Down Expand Up @@ -366,10 +365,6 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.7.1)
unicorn (4.8.3)
kgio (~> 2.6)
rack
raindrops (~> 0.7)
validates_email_format_of (1.6.1)
i18n
vanity (2.0.0.beta8)
Expand Down Expand Up @@ -428,6 +423,7 @@ DEPENDENCIES
pg
pg_search
pry-rails
puma
quiet_assets
rack-canonical-host
rack-mini-profiler
Expand All @@ -454,7 +450,6 @@ DEPENDENCIES
stripe_event
timecop
uglifier
unicorn
validates_email_format_of
vanity (= 2.0.0.beta8)
webmock
Expand Down
2 changes: 1 addition & 1 deletion Procfile
@@ -1,2 +1,2 @@
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
web: bundle exec puma -p $PORT -C ./config/puma.rb
worker: bundle exec rake jobs:work
28 changes: 28 additions & 0 deletions config/puma.rb
@@ -0,0 +1,28 @@
# https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server

# The environment variable WEB_CONCURRENCY may be set to a default value based
# on dyno size. To manually configure this value use heroku config:set
# WEB_CONCURRENCY.
#
# Increasing the number of workers will increase the amount of resting memory
# your dynos use. Increasing the number of threads will increase the amount of
# potential bloat added to your dynos when they are responding to heavy
# requests.
#
# Starting with a low number of workers and threads provides adequate
# performance for most applications, even under load, while maintaining a low
# risk of overusing memory.
workers Integer(ENV.fetch("WEB_CONCURRENCY", 2))
threads_count = Integer(ENV.fetch("MAX_THREADS", 2))
threads(threads_count, threads_count)

preload_app!

rackup DefaultRackup
environment ENV.fetch("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
31 changes: 0 additions & 31 deletions config/unicorn.rb

This file was deleted.

0 comments on commit 51312cf

Please sign in to comment.