0

I was wondered that how does python grpc maxworker work. If I set maxworker 10

grpc.server(futures.ThreadPoolExecutor(max_workers=int)

Does it mean if I send 15 req to the grpc server, it will only handle 10 req at the same time(if my cpu num support this amount of concurrency). The other 5 req will hang on until the first btach with 10 req finish handling.

1 Answers1

0

Short answer: Yes

Long answer:

  1. The request will hang on if current requests reach to max_workers
  2. If you do not set max_workers, it depends on your CPU but no more than 32 since Python 3.8
  3. You can still set a large number greater than your CPU limit.

https://docs.python.org/3/library/concurrent.futures.html#threadpoolexecutor

jaguar
  • 33
  • 1
  • 6