Reputation: 769
Am running an app with Flask , UWSGI and Nginx. My UWSGI is set to spawn out 4 parallel processes to handle multiple requests at the same time. Now I have one request that takes lot of time and that changes important data concerning the application. So, when one UWSGI process is processing that request and say all others are also busy, the fifth request would have to wait. The problem here is I cannot change this request to run in an offline mode as it changes important data and the user cannot simply remain unknown about it. What is the best way to handle this situation ?
Upvotes: 1
Views: 1167
Reputation: 2909
As an option you can do the following:
This way the HTTP requests won't be blocked for the complete function execution time.
Upvotes: 1