There's no control over the underlying thread pool that gRPC uses. Those functions control threads created by PyArrow, not gRPC.
Mostly, if you are in Python, this won't matter. (C)Python is effectively single-threaded anyways, and gRPC will use as many threads as there are RPC calls. (You can get concurrency, but not parallelism.) If you need true parallelism, consider something other than Python or figure out if multiprocessing works for your use case. (You would get the RPC call, then do work in multiprocessing, then send the result back in the RPC call handler.) On Mon, Feb 13, 2023, at 15:35, filippo medri wrote: > Hi, > I am trying to build a flight server (using pyarrow) that can handle multiple > requests at the same time (`do_get` and `do_put` ) and I'd like to understand > which is the best practice . > I am also trying to understand if there is a way from pyarrow to control the > thread pool size of a flight server. > I see that there are a couple of methods > (https://arrow.apache.org/docs/python/generated/pyarrow.cpu_count.html#pyarrow.cpu_count > and > https://arrow.apache.org/docs/python/generated/pyarrow.io_thread_count.html#pyarrow.io_thread_count) > defined at module level and documented here > https://arrow.apache.org/docs/python/api/misc.html). > Are these methods the ones controlling the concurrency of a flight server > created through pyarrow or are these generically referring to all the threads > used by pyarrow? > > Thanks in advance, > Filippo Medri >
