Cloud 66

Thin rack server

Run your Rack apps with Thin

Contents

About running apps with Thin

Thin is a Ruby web server that can handle high levels of concurrency. Cloud 66 uses the following signals to control Thin:

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 (hot-restart)

sudo bluepill cloud66_web_server restart

kill -USR2 <pid>

Deploy with Thin

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 Thin Rack server, add a line to your Procfile labeled as custom_web. Here is an example:

custom_web: bundle exec thin start --socket /tmp/web_server.sock --pid /tmp/web_server.pid -e $RACK_ENV -d

Please take note that Thin is running in Daemon mode with the -d parameter.

Important

Your web server is not automatically restarted during redeployment. If you would like for it to restart automatically, you can accomplish this using a deploy hook.