-
-
Save sigerello/3000429 to your computer and use it in GitHub Desktop.
Using unicorn on heroku part 9000
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
# config/initailizers/newrelic_reconnect.rb | |
# https://newrelic.com/docs/troubleshooting/im-using-unicorn-and-i-dont-see-any-data | |
# Ensure the agent is started using Unicorn | |
# This is needed when using Unicorn and preload_app is not set to true. | |
# See http://support.newrelic.com/kb/troubleshooting/unicorn-no-data | |
NewRelic::Agent.after_fork(:force_reconnect => true) if defined? Unicorn |
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
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
# config/unicorn.rb | |
# Minimal Heroku unicorn config | |
# I found no real gain from preload_app=true on Heroku | |
# Heroku has a 30s timeout so we enforce the same | |
# Depending on memory usage workers can be bumped to 3-4 | |
# preload_app=true can cause issues if you don't reconnect things correctly | |
worker_processes 3 | |
timeout 30 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment