Python – How to run multiple Tornado processes/threads/frontends

deploymentpythontornado

In the tornado documentation they show how they can have a very large through-put from 4 frontends. I'd like to run an app in the same way, and would like to have the frontends running as daemon processes managed with an init.d script*.

I'm fairly new to Python so don't really know where to start. Currently I'm starting the Tornado server manually in the terminal, passing in a new port number each time.

I've tried using the python-daemon package in conjunction with the lockfile package but the lockfiles that are created don't have the process ids in them and I can't see how to then kill the processes gracefully later on.

I don't really know where to go from here, and the Tornado docs leave a large chunk out regarding deployment.

* If there's a better way to manage the processes so that they can be monitored and managed as a group then please let me know.

Best Answer

Try Supervisor. It's great for managing multiple daemon processes. You configure your applications in the supervisord.conf file and supervisord itself is launched from an init.d script.

Related Topic