forked from ninetwentyfour/Hospitium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change prod server from thin to unicorn
- Loading branch information
1 parent
6dab95e
commit 52bf5c0
Showing
6 changed files
with
31 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
web: bundle exec thin start -p $PORT -e $RACK_ENV | ||
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# config/initailizers/newrelic_reconnect.rb | ||
|
||
# Ensure the agent is started using Unicorn | ||
# This is needed when using Unicorn and preload_app is NOT set to true. | ||
# https://newrelic.com/docs/ruby/no-data-with-unicorn | ||
if Rails.env.production? | ||
NewRelic::Agent.after_fork(:force_reconnect => true) if defined? Unicorn | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# config/unicorn.rb | ||
|
||
# Minimal Heroku unicorn config | ||
# * I found no real gain from enabling preload_app on Heroku (which makes for faster worker starts/restarts), | ||
# and it will cause strange issues if you don't re-establish all connections correctly | ||
# * Heroku has a 30s timeout so we set to 60, allowing them to handle timeouts and issue an H12 error | ||
# * Depending on your memory usage workers can be bumped to 3-4. With Sinatra it can be 8+ | ||
worker_processes 3 | ||
timeout 60 |