Replies: 1 comment 1 reply
-
That issues appears to exist only when you pass an external file-descriptor to Uvicorn, leaving the accept loop to an external supervisor, which is not an available feature on Granian. So if that's your use-case, it cannot be achieved with Granian.
I'm not sure why you're stating that; the code you mentioned is used on all protocols, not on WSGI only.
The load balancing in connections between workers is performed by the Linux kernel (which is the only effective OS to use |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Granian team,
Thanks for implementing such a performant server for ASGI apps. I'm in the process of switching from uvicorn due to an issue of uneven distribution of requests when running with multiple workers. (A similar issue is discussed in this ticket: encode/uvicorn#2467). The PR to solve this issue is still in draft status.
I was wondering if Granian is free of this issue. I checked the code, and the reuse_port is only set in WSGI implementation here:
granian/src/tcp.rs
Line 43 in 5074d01
In my test, the work load is CPU-bound, and the GIL contention is a major issue that restricts throughput if the load is uneven. I have to set the backpressure to 1 to enforce a balanced distribution across workers under high load, but this is apparently a hack not a solution.
So is there any config I can use to ensure the balanced distribution of incoming requests across all workers? Thanks a lot.
Beta Was this translation helpful? Give feedback.
All reactions