-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch server from unicorn to puma #1927
Merged
Merged
Conversation
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
Step 1: Improve thread safety. PR #1932 |
Was just thinking about this due to the outage this morning. Great to see progress here! |
…m-observer into unicorn-to-puma
…into unicorn-to-puma
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is to help switch the production server from unicorn to puma, without turning on threading.
It follows the only complete guide I've found, but it's pretty old:
Migrating from unicorn to puma with no downtime
Current preferred way is to run Puma via
systemd
, notinit.d
Note that there is no file
/etc/systemd/system/unicorn.service
on production, what we have is/etc/init.d/unicorn
puma
in this branch/config/puma.rb
in this branch/config/puma-dev.rb
in this branch (in case Jason wants to run it locally)/config/etc/puma.service
and copy to/etc/systemd/system/puma.service
on production/deploy.sh
in this branch not to reload Unicornconfig/etc/nginx.conf
in this branch to point to new Puma socket instead of UnicornCheck example of
upstream
andproxy_pass
configs hereDeploy this PR. Then:
/config/etc/nginx.conf
to/etc/nginx/nginx.conf
sudo systemctl start puma.service
so it's running alongside Unicornsudo systemctl status puma.service
be sure it's runningsudo systemctl reload nginx
(to listen to the Puma socket)sudo systemctl stop unicorn.service
(or maybesudo uni stop
, since there's no such thing asunicorn.service
)sudo systemctl disable unicorn.service
(or maybe remove the init file in/etc/init.d/unicorn
)sudo systemctl enable puma.service
Reference:
Benefits of Switching from Unicorn to Puma
Puma docs: Configuration and Deployment
How Do I Know Whether My Rails App Is Thread-safe or Not?
Do we want to consider using Capistrano for deployment?