Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gRPC direct executor best practices for non-blocking code #1140

Open
abdullahjamal1 opened this issue Sep 10, 2024 · 0 comments
Open

gRPC direct executor best practices for non-blocking code #1140

abdullahjamal1 opened this issue Sep 10, 2024 · 0 comments
Labels
question A question about this library or its usage

Comments

@abdullahjamal1
Copy link

abdullahjamal1 commented Sep 10, 2024

The context

I am trying to use direct executor for my spring webflux application, in place of fixed thread pool executor as it seems to be more performant according to posts as this one grpc/grpc-java#5185 .

   @Bean
    public GrpcChannelConfigurer grpcChannelConfigurer() {
        return (channelBuilder, name) -> {
            if (channelBuilder instanceof NettyChannelBuilder nettyChannelBuilder) {
                nettyChannelBuilder.directExecutor();
            }
        };
    }

The question

I just want to know what if there are any other best practices or config changes, which i need to do if i am using direct executor.
from https://stackoverflow.com/questions/47505022/does-grpc-server-spin-up-a-new-thread-for-each-request, i came to know that we should also modify some bossEventLoopGroup and workerEventLoopGroup, is that required if are using this library instead of just native one.

The application's environment

  • Spring (boot):
  • grpc-java: 1.65.1
  • grpc-spring-boot-starter: 3.1.0.RELEASE
  • java: 17
@abdullahjamal1 abdullahjamal1 added the question A question about this library or its usage label Sep 10, 2024
@abdullahjamal1 abdullahjamal1 changed the title gRPC direct executor settings gRPC direct executor best practices for non-blocking code Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A question about this library or its usage
Projects
None yet
Development

No branches or pull requests

1 participant