Nginx rolling restart of Rails app with capistrano Nginx rolling restart of Rails app with capistrano nginx nginx

Nginx rolling restart of Rails app with capistrano


run "cd #{deploy_to}/current && echo 'ok' > public/lb.txt", :host => s.host

should actually be:

run "cd #{deploy_to}/current && echo 'ok' > public/lb.txt", :hosts => s.host


I ran across this gem capify-ec2 which has a rolling restart feature. capify-ec2 on github.

I am about to install it and try it out.

Here's the description from the readme that describes what their rolling restart feature does:

"This feature allows you to deploy your code to instances one at a time, rather than simultaneously. This becomes useful for more complex applications that may take longer to startup after a deployment. Capistrano will perform a full deploy (including any custom hooks) against a single instance, optionally perform a HTTP healthcheck against the instance, then proceed to the next instance if deployment was successful.

After deployment a status report is displayed, indicating on which instances deployment succeeded, failed or did not begin. With some failures, further action may need to be taken manually; for example if an instance is removed from an ELB (see the 'Usage with Elastic Load Balancers' section below) and the deployment fails, the instance will not be reregistered with the ELB, for safety reasons."