I'm running a Python application which uses flask and apache. When a second person uses the app it waits till the first process ends making everything pretty slow. It's supossed to run with atleast 20 users simultaneosly. What should I do? (sorry for my bad eng)
Asked
Active
Viewed 6,379 times
-1
-
2Could you show your code here? It'll make it easier for people to see what might be wrong. – bouteillebleu May 08 '17 at 12:19
2 Answers
4
Using the simple app.run() from within Flask creates a single synchronous server on a single thread capable of serving only one client at a time.
app.run(threaded=True)
threaded=True
will process each request in a separate thread.

Karthikeyan KR
- 1,134
- 1
- 17
- 38
1
apache should take care of that for you. see http://flask.pocoo.org/docs/0.12/deploying/mod_wsgi/ for details on how to implement this for a flask app.

teknoboy
- 175
- 1
- 2
- 12