Using Unicorn Rack server
Unicorn is a Rack HTTP server that uses forked processes to handle multiple incoming requests concurrently.
Deploy with Unicorn
You need to choose your Rack server at the time of initial build of the application. Changes to or from Passenger (the default web app / Rack server) will not be applied after your application 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):
Controlling your Unicorn server
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