Skip to main content

Posts

Showing posts with the label mod_usgi

Python, Flask, Concurrency and Windows

This blog is for those who have written a program in Python and exposed it as API using Flask. You might have written the python algorithm and will be happy to see the output. With small usage and limited users, it still works by making some configuration changes. Problem arises when you host the same API in Production where multiple users are browsing it. Why it does not work in Production as local environment? In production, mutiple requests come to server from mutiple locations. If setup is not tuned to cater to concurrent users, either these requests will make the API down or will be throwing exception like 'Internal server error'. How can we configure the setup to serve concurrent users? There are few configuration which you have to keep in mind while designing the eco system to accomodate mutiple users. Make sure Python is installed on server.  Download Download pip from get-pip.py and run command python get-pip.py Install Flask using pip commands pip ins...