0

I have a Python application written on Flask microframework. I use this application as the black box via REST API. Right now I faced the issue that after concurrent API calls to this application - it stops responds and my HTTP client fails with the connection timeout.

I'm not a Python developer and right now I'm unable to change anything inside of this application. Is it possible to create something like an isolated pool of these applications to be able to work with them in the concurrent environment? If so, could you please tell me how it can be achieved.

alexanoid
  • 24,051
  • 54
  • 210
  • 410
  • Is it feasible to run multiple instances of this application, say, in their own Docker containers, and then configure a frontend mechanism to distribute incoming requests between containers, to lighten the load on the hosts? – Green Cloak Guy Aug 10 '18 at 13:25
  • 1
    You mean like the [deployment options](http://flask.pocoo.org/docs/1.0/deploying/)? You can launch your app via gunicorn with a single command, even without Heroku. Or am I misunderstanding? – roganjosh Aug 10 '18 at 13:31
  • thanks, could you please tell how gunicorn can fix this issue? – alexanoid Aug 10 '18 at 13:37
  • 1
    Well, I'm still not sure that I've understood the issue properly, but you can spawn multiple threads/processes (both are possible) to host your app via gunicorn and get around the development server that's packaged with Flask. – roganjosh Aug 10 '18 at 13:38
  • Thanks for your suggestion, I'll try ! – alexanoid Aug 10 '18 at 13:52

0 Answers0