Your welcome and yes, Tornado is one of the best kept Python secrets…… not sure why folks use Django…. Oh I didn't say……. that did I. ;-)
These days depending on loads and needs really I see no reason to sit Tornado behind a front end HTTP server it seems so 90's to me.
But it could make sense in some or many cases where that front end is directing incoming calls for you.
These days all the craze is Docker, but for my needs and desires either legacy LXC or the new incoming( not production level yet ) Go based handler for containers known as LXD is the way to go.
The Ubuntu camp just annouced yesterday Fan which is one more take on dealing with containers and networking issues.
I think any one who gives you some stock answer as to what is the recommended or best way to setup Tornado is doing an injustice to you.
I for one have never even touched one of the Tornado's core original features …..long polling….. let alone used Websockets all that often …...as I really was after it's IOLoop more than anything else.
Any honestly I think it has one the nicer Python based url router ideas ( which I think was based or influnced on WebPy as I recall ).
It just makes better sense to me to look at using lots of LXC based Tornado instances when it comes to blocking calls than messing with Threads and Thread pools… but to each their own.
Don't forget Python( like Ruby, PHP and many others ) itself is single threaded and the GIL deals with all of Python's internal guts.
So messing with thread pools is for people who want to think some how it's all working and are too lazy to figure out how to do Async style calling but at some point a processor can only do one thing at a time.
Just about everything I've read shows that the Async model is big, better, and faster than a process level thread model……. but it takes more thought and energy to get going with async model.
At times it's just okay to let Tornado block as, you have too or there is no other better options….. that's where multiple instances solve the underlaying issues and they could be running on other processor cores.
Tornado itself is wicked fast… but it's not a C based HTTP engine either…. but don't let any one fool you it's smoking fast …... lean and clean.
A basic Tornado instance uses about 17 MB of ram… so figure it out you can run lots of LXC containters with lots of Tornado instances doing lots of things.
No reason you can run 100 to 500 LXC containers on decent processor with enough ram…… read up on it might change or open up your thoughts on that whole model of doing things.
A LXC allows you to control total ram, processor usage, disk access and lots of other stuff far better than simple Unix process.
With all the containers headed or going towards Atomic based images that opens up a whole better why to do things in production as well as development.
Plus Tornado's template engine is very nice and does the job without getting in the way, but not a lot not is said about it either.
I think the core reason why in the Python world Tornado is not talk about all that much is most Pythonista just have not caught on to Async yet.
Twisted with it's depth and twists really has not made the topic all that approachable ……..so most people opted for Django the easy answer……. maybe some day I understand why, but Django for me is one huge set of hand cuffs that far too many people are using for all the wrong reasons or way, but hey it get's the job done for them, so it must be working for them.
Now with Torando being able to use the Python standard library's Asyncio calls who knows what the future may bring. Not sure what that is or why yet… but Tornado just works fine today.
I think Brett laid down a soild core and Ben has kept it alive and moving forward and made it solid.
All along keeping it simple and lean in the end is the best way to do lots of projects and not enough Pythonista are using it like they should be.
But maybe some day they might wake up… but hey maybe it's better that that masses don't come and want to mess and change it from it's core rasion d'etre.
-Kevin