I am making a uwsgi web app with python and came across a requirement where I have to limit the no. of requests that the server should accept. Here , I came across the uwsgi option max-requests. But the help says help: reload workers after the specified amount of managed requests.
Since I am not an native english speaker , I could not understand what that meant exactly.
My current understanding is :
Suppose I set max-requests to 100 , the 10 workers. I get 150 requests , 100 requests are served and the rest are put in some queue . (?) After the 1st request is done , the 101st request is accepted by the worker. (?)
Please clarify/help.
So your Python code is run in workers. There are usually several of them in parallel. The max-requests specifies that, after a certain number of requests per worker, it is reloaded. Basically, your Python code is restarted every max-requests.
In you example, if you have 150 requests with 10 workers, nothing will happen (because 150/10 < 100).
But after 1000 requests, workers will be reloaded (which will take some time, but it's probably fine because there are 10 workers so they won't be all reloaded at the same time). There are no queues there.