7

We are using uwsgi to serve the python app behind nginx.

Can I hope that the theoretical maximum of simultaneously served client connections is equal to uwsgi processes * threads?

We are using server-sent events, so, the connections are held for a long time.

2 Answers 2

4

yes, every single thread can manage a single request, so if you have 3 processes and 5 threads you can manage 15 concurrent requests.

1

when hosting python behind uWSGI, it can only run as many simultaneous requests as processes there are. If you have more threads uwsgi will take more http requests but will keep them on hold until a process is freed up of a previous request.

This can be checked by doing a request that time.sleep(300) then spawn curl commands from terminals and you will see what I described above.

1
  • This is important in combination with the accepted answer. Note that a process can handle executing multiple threads "concurrently" though as long as one thread is waiting for some other task.
    – Akaisteph7
    Commented Sep 7, 2023 at 22:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .