grpc-spring
grpc-spring copied to clipboard
Use FixedThreadPool as default executor
The problem
When creating default GrpcServer or ManagedChannel the library uses CachedThreadPool as executor. Under load it may lead to running out of available threads and starvation.
The solution
Use a FixedThreadPool as an executor and make a configuration property for number of threads in it.
Alternatives considered
Now it is only possible via manual configuring ChannelConfigurer/ServerConfigurer
Additional context
Here https://stackoverflow.com/questions/42408634/what-is-the-exact-use-of-the-executor-in-grpc-java-s-serverbuilder-does-it-just grpc developer mentions that FixedThreadPool is more appropriate approach then default one/
BTW it is my 1st feature request ever, don't be mad if I did it wrong somehow...
I'll probably add it along with: https://github.com/yidongnan/grpc-spring-boot-starter/issues/449
Due to time constraints I move this to the next milestone
this question can be resolved by GrpcServerConfigurer? @ST-DDT
As a workaround yes. The actual implementation by this lib should probably be inside the related factories.
@ST-DDT when is this going to merge any idea ? Also how does the workaround with GrpcServerConfigurer look like ?