benoitc / gunicorn

gunicorn 'Green Unicorn' is a WSGI HTTP Server for UNIX, fast clients and sleepy applications.
http://www.gunicorn.org
Other
9.73k stars 1.74k forks source link

when worker calss is eventlet, how to choose free worker to handle received request? #3270

Open dawenxi-only opened 1 month ago

benoitc commented 1 month ago

What do you mean ? accepted response are always passed to the wsgi callback. Can you clarify what you're asking for?

dawenxi-only commented 1 month ago

I deployed a multi process HTTP service using Gunicorn, but during stress testing, I found that requests were not evenly distributed among these processes.Is there any way to achieve even distribution of requests?

benoitc commented 1 month ago

dispatching of requests depends on the OS kernel and the scheduling policy you have set. If the system consider once process can still accept connections it will dispatch the connection accordingly. You shouldn't be worried of uneven distribution.

dawenxi-only commented 1 month ago

Thank you for your response. I am concerned that multiple requests concentrated in one process may affect performance.

benoitc commented 1 month ago

well the schedulet of the kernel is taking care of it. Some schedulers can balance the requests more often. If you use linux check https://docs.kernel.org/scheduler/index.html