Reputation: 147
I am setting up a server, which receives task. These tasks can have various amounts of workload and they may be incoming at the same time.
The tasks shall be done in python, so I went for a Flask server. My problem is that, by processing multiple requests at the same time, with the simple way of putting one request in one thread (as don't by default if you serve the flask app as standalone), I don't get 'real' parallelism due to the GIL.
So my question is: Which wsgi-interface can I use to serve my Flask-app on multiple processes? I already tried some, but didn't got the results I wanted (twisted, waitress).
Important: I have to work on windows.
EDIT: I'm working with Visual Studio. A solution which can be embedded in VS would be nice, but not necessary
Upvotes: 0
Views: 877
Reputation: 132
Gunicorn is pretty great. We've used it on past projects.
Also just thought it would be worth checking: are you using the threaded option in your flask server?
app.run(host=HOST, port=PORT, threaded=True)
That might solve your problems.
Upvotes: -2