[Flask] Flask Deployment on Tornado

errata at gmx.com errata at gmx.com
Tue Apr 12 13:20:47 EDT 2016


The Flask docs include this snippet for deploying a Flask app on Tornado:

http_server  =  HTTPServer(WSGIContainer(app))
http_server.listen(5000)
IOLoop.instance().start()


But the Tornado docs have this to say about deploying WSGI apps using 
WSGIContainer:


> Warning
>
> WSGI is a/synchronous/interface, while Tornado’s concurrency model is 
> based on single-threaded asynchronous execution. This means that 
> running a WSGI app with Tornado’s|WSGIContainer| 
> <http://www.tornadoweb.org/en/stable/wsgi.html#tornado.wsgi.WSGIContainer>is/less 
> scalable/than running the same app in a multi-threaded WSGI server 
> like|gunicorn|or|uwsgi|. Use|WSGIContainer| 
> <http://www.tornadoweb.org/en/stable/wsgi.html#tornado.wsgi.WSGIContainer>only 
> when there are benefits to combining Tornado and WSGI in the same 
> process that outweigh the reduced scalability.
>

So, is the consensus opinion to stick with gunicorn or uwsgi for deployment?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20160412/36ef6498/attachment.html>


More information about the Flask mailing list