Does gRPC server spin up a new thread for each request?

后端 未结 2 1493
走了就别回头了
走了就别回头了 2021-02-06 00:44

I tried profiling a gRPC java server. And i see the below set of thread pools majorly.

  • grpc-default-executor Threads : Created 1 for each incoming request.
  • <
2条回答
  •  说谎
    说谎 (楼主)
    2021-02-06 01:29

    As far as I know you can specify using the directExecutor() when building the GRPC server / client that will ensure all work is done in the IO thread and so threads will be shared. The default is to not do this for safety reasons as you will need to be very careful about what you do if you are in the IO Thread (like you should never block there).

提交回复
热议问题