Last active
December 5, 2017 20:23
-
-
Save wwhiro200/d17ac1b4062150e0cdb12356280da9a6 to your computer and use it in GitHub Desktop.
Puma + Sidekiq: systemd units and configs
This file contains hidden or 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
#!/usr/bin/env puma | |
environment = ENV.fetch('RAILS_ENV', 'production') | |
threads 0, 4 | |
workers 1 | |
bind 'tcp://0.0.0.0:9292' | |
preload_app! | |
plugin :tmp_restart |
This file contains hidden or 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
[Unit] | |
Description=Puma HTTP Server | |
After=network.target | |
[Service] | |
Type=simple | |
User=deploy | |
WorkingDirectory=/var/www/[app_path]/current | |
EnvironmentFile=/etc/environment | |
ExecStart=/home/deploy/.rbenv/bin/rbenv exec bundle exec puma -C config/puma.rb | |
Restart=always | |
[Install] | |
WantedBy=multi-user.target |
This file contains hidden or 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
[Unit] | |
Description=Sidekiq workers | |
After=network.target | |
[Service] | |
Type=simple | |
User=deploy | |
WorkingDirectory=/var/www/[app_path]/current | |
EnvironmentFile=/etc/environment | |
ExecStart=/home/deploy/.rbenv/bin/rbenv exec bundle exec sidekiq -C config/sidekiq.yml -e production | |
Restart=always | |
[Install] | |
WantedBy=multi-user.target |
This file contains hidden or 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
--- | |
:concurrency: 4 | |
:queues: | |
- [default, 10] | |
:logfile: /var/www/[app_path]/shared/log/sidekiq.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment