I want to run a flask app on tornado server and scale the number of requests it handles. I found similar code as bellow on flasks deployment documentation. But when I am running this and testing for load using jmeter I found it is not scaling at all. If I used it for 5 users and sleep time was of 5 seconds in flask then it was taking 25 seconds to complete tells it is serving one request at a time. Secondly I am not getting why tornado is removed from flasks deployment documentation from version .11.x while it was present in .10.x (reference link). One more suggestion if someone could help me finding the best server for my flask app where my requirements are as follows: I have almost 40 flask apps, which I have to host. Machine config: 8 cores with 16 gb RAM. I am expecting a maximum of 100 users at a time on a particular flask app. One of my flask app takes almost 2 seconds to finish off a job.
from flask import Flask
import time
app = Flask(__name__)
@app.route('/flask')
def hello_world():
time.sleep( 5 )
return 'Hello World'
if __name__ == "__main__":
app.run()
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from flasky import app
http_server = HTTPServer(WSGIContainer(app))
http_server.listen(12000)
IOLoop.instance().start()