Replies: 1 comment 1 reply
-
Nevermind. Found the solution. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there.
I have Gunicorn managing, say, 10 Uvicorn workers i.e.
gunicorn -w 10 -k uvicorn.workers.UvicornWorker
.How is incoming traffic being distributed across the 10 workers? What algorithm is used and can I control or inspect it?
For my testing, I wrote a FastAPI endpoint that sleeps for 30 seconds, and implemented a middleware that increments a counter each time a request is being processed. I then used
curl
in a loop to call that FastAPI a few hundred times.@benoitc Help?
I noticed the counter is not evenly incremented across all the uvicorn workers. Some workers end up getting more traffic than others. Is this a known issue? Can someone help explain how traffic distribution works?
Beta Was this translation helpful? Give feedback.
All reactions