4 ms·
Given Tornado's single threaded design, a production service should run multiple instances of Tornado behind a proxy. Upstart does not help with the multiple i
by frognibble 16y ago
Given Tornado's single threaded design, a production service should run multiple instances of Tornado behind a proxy.
Upstart does not help with the multiple instance problem. Upstart adds the problem of running code with elevated privilege.
I think it might be simpler to write a script to start/stop/restart daemon Tornado instances running in an unprivileged account.
- hoop 16y agoHi frognibble, From what I understand, Tornado already starts multiple instances by default; the exact number of which is determined by the number of cores available. Is this still not adequate? Please let me know because I would love to update my article(s) to be as accurate and as helpful as possible. Thanks!
- frognibble 16y agoIf request handlers block (by calling MySQL among other things), then one instance of Tornado per core may not be sufficient to take advantage of a machine's resources. Tornado includes optional code to fork more than one instance where the number of instances defaults to the number of cores. Tornado's forking code has issues: - There's no code to restart dead child processes. - It's not possible to do a rolling upgrade because all instances of the server must be restarted at the same time. I'd stay away from the forking code in Tornado. I suspect that it's not used by FriendFeed because the forking code was added well after the initial release of Tornado.
- hoop 16y agoThank you for your insight. Do you know of anything that implements this already (child monitoring and rolling restarts/upgrades)?
- frognibble 16y agoI do not know of anything that implements this. I recommend asking on the Tornado news group.
- deleted 16y ago[deleted]