Skip to content

Commit

Permalink
Switching web process to Unicorn for more concurrency on Heroku
Browse files Browse the repository at this point in the history
  • Loading branch information
flov committed Jul 17, 2013
1 parent 1d2b41a commit 3150dcb
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source 'https://rubygems.org'
ruby '1.9.3'
gem 'rails', '3.2.12'
gem 'pg'
gem 'thin'
gem 'unicorn'

group :assets do
gem 'jquery-rails', '3.0.1'
Expand Down
13 changes: 7 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ GEM
capybara (>= 1.1.2)
cucumber (>= 1.1.3)
nokogiri (>= 1.5.0)
daemons (1.0.10)
database_cleaner (0.7.1)
decent_exposure (2.2.0)
devise (1.5.3)
Expand Down Expand Up @@ -196,6 +195,7 @@ GEM
json (1.8.0)
jwt (0.1.5)
multi_json (>= 1.0)
kgio (2.8.0)
launchy (2.1.2)
addressable (~> 2.3)
macaddr (1.6.1)
Expand Down Expand Up @@ -264,6 +264,7 @@ GEM
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
raindrops (0.10.0)
rake (10.1.0)
ransack (0.7.2)
actionpack (~> 3.0)
Expand Down Expand Up @@ -314,10 +315,6 @@ GEM
sprockets (>= 1.0.2)
systemu (2.5.2)
term-ansicolor (1.0.7)
thin (1.3.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.14.6)
tilt (1.4.1)
treetop (1.4.12)
Expand All @@ -328,6 +325,10 @@ GEM
uglifier (1.2.3)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
unicorn (4.6.2)
kgio (~> 2.6)
rack
raindrops (~> 0.7)
uuid (2.3.6)
macaddr (~> 1.0)
vcr (2.5.0)
Expand Down Expand Up @@ -405,8 +406,8 @@ DEPENDENCIES
selenium-webdriver
shoulda-matchers
simple_form
thin
uglifier
unicorn
vcr
web_translate_it
will_paginate (~> 3.0.pre2)
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: bundle exec unicorn_rails -p $PORT -c ./config/unicorn.rb
12 changes: 12 additions & 0 deletions config/unicorn.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# If you have a very small app you may be able to
# increase this, but in general 3 workers seems to
# work best
worker_processes 3

# Load your app into the master before forking
# workers for super-fast worker spawn times
preload_app true

# Immediately restart any workers that
# haven't responded within 30 seconds
timeout 30

0 comments on commit 3150dcb

Please sign in to comment.