基础知识:grpc线程模型
可参考https://blog.youkuaiyun.com/jek123456/article/details/80451500
如何设置netty线程数
-Dio.netty.eventLoopThreads可以设置io线程数
如何设置服务端执行线程数
server = ServerBuilder.forPort(port)
.addService(new GreeterImpl())
.addService(ProtoReflectionService.newInstance())
.executor(new ScheduledThreadPoolExecutor(2, getThreadFactory("grpc-executor" + "-%d", true)))
.build()
.start();
调用executor方法,传入自定义线程池