GRPC Streaming and gevent: Each channel needs native thread and leads to overflow

Skip to first unread message

Aleh Strakachuk

Sep 14, 2023, 11:16:38 AM9/14/23

I'm using python and locust to load test grpc endpoints. I also need to hold stream connection in addition to unary grpc calls.

So, as I see in the current implementation, it was made in

# Currently, each channel corresponds to a single native thread in the
# gevent threadpool. Thus, when the unit test suite spins up hundreds of
# channels concurrently, some will be starved out, causing the test to
# increase in duration. We increase the max size here so this does not
# happen.

I need to increase threadpool.maxsize variable to thousands in order to make it possible to hold stream connection by thousands users. User ~ threads count.

Is it possible to make that one native thread will process many channels at once?

Reply all
Reply to author
0 new messages