Is there a canonical code deployment strategy for tornado-based web application deployment. Our current configuration is 4 tornado processes running behind NginX? (Our specific use case is behind EC2.)
We've currently got a solution that works well enough, whereby we launch the four tornado processes and save the PIDs to a file in /tmp/. Upon deploying new code, we run the following sequence via fabric:
- Do a git pull from the prod branch.
- Remove the machine from the load balancer.
- Wait for all in flight connections to finish with a sleep.
- Kill all the tornadoes in the pid file and remove all *.pyc files.
- Restart the tornadoes.
- Attach the machine back to the load balancer.
We've taken some inspiration from this: http://agiletesting.blogspot.com/2009/12/deploying-tornado-in-production.html
Are there any other complete solutions out there?