Phillip B Oldham
Phillip B Oldham

Reputation: 19365

How to run multiple Tornado processes/threads/frontends?

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.

Upvotes: 5

Views: 3118

Answers (2)

user213251
user213251

Reputation: 11

I can vouch for Supervisor too. We have been using tornado in production with 4 instances using supervisor and it is working uber smooth

Upvotes: 1

dowski
dowski

Reputation: 3236

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.

Upvotes: 6

Related Questions