Lets say I have a Django app that is processing images. User POSTs an image to a view, the view function is processing this image, and then returns a modified one. Lets say a processing can take ~5sec.
Or lets say I have a view that needs to make a request to another web-server. This connection and data download may take ~5secs.
What will happen if three users try to use my django app at the same time? Will Django handle the requests one-by-one, causing third user to wait ~15secs?
I have found four methods of handling requests simultaneously in Django (please correct me if I am wrong):
One is to use a third-party software called Celery to handle tasks in the background. This method was proposed here: Can Django do multi-thread works? . This method requires:
Django project reconfiguration
Celery "server/worker" process running
async functions/views should be decorated with a
Second method is to configure Apache/uWSGI/gunicorn server to use "workers". This method requires only server configuration. This method is partially mentioned here: Django, sleep() pauses all processes, but only if no GET parameter?
Third is to simply use Python threads for views. Like in this example: Multithreading for Python Django
Four is to use a django-background-tasks app (https://pypi.python.org/pypi/django-background-tasks).
Can anyone elaborate on this topic please? What are the good and bad sides of each of these solutions?