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

后端 未结 2 995
我寻月下人不归
我寻月下人不归 2021-02-06 01:09

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:43

    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).

提交回复
热议问题