About running apps with Unicorn rack server
Unicorn is a Rack HTTP server that uses forked processes to handle multiple incoming requests concurrently.
Cloud 66 uses the following signals to control Unicorn:
Kill the web server
- kill -QUIT <pid>: Stop the process
- kill -USR2 <pid>: Spin off another master process.
- kill -s TTIN <pid>: Add a new worker to the master process
Stop the web server
sudo bluepill cloud66_web_server stop
Start the web server
sudo bluepill cloud66_web_server quit
sudo bluepill load /etc/bluepill/autoload/cloud66_web_server.pill
Restart the web server (zero-downtime)
sudo bluepill cloud66_web_server restart
Deploy with Unicorn
You need to choose your web server at the time of initial build of the stack. Changes to or from Passenger (the default web server) will not be applied after your stack has initially been analyzed. You can however change freely between other supported servers by simply updating your Gems and Procfile.
To run a Unicorn Rack server, add a line to your Procfile labeled as custom_web. Here is an example:
Please take note that Unicorn is running in Daemon mode with the
Please ensure to follow the conventions set out in the configuration below if you are having issues, and that you are using an up-to-date version of Unicorn.
Here is a unicorn.rb configuration file that is compatible with Cloud 66 requirements (following the Procfile line above, this should be located under the
config folder of your Rails app):