Got it, thank you!

On Thursday, March 1, 2018 at 4:11:18 PM UTC-5, Carl Mastrangelo wrote:
>
> Answers inline
>
> On Thursday, March 1, 2018 at 12:53:15 PM UTC-8, vicva...@gmail.com wrote:
>>
>>
>> Hi Guys,
>>
>> Can someone please answer a few questions about GRPC threading model?
>>
>> If I create a ManagedChannel thusly:
>>
>> NettyChannelBuilder builder =  NettyChannelBuilder.forAddress( host, port 
>> );
>> builder.eventLoopGroup( new NioEventLoopGroup(2) );
>> builder.executor( new ThreadPoolExecutor( 1, 1, 0L, 
>> TimeUnit.MILLISECONDS, new ArrayBlockingQueue<>( 10000 ));
>>
>> 1) The 2 EventLoop threads will be used to process data from the network?
>> 2) The single user thread will be used for callbacks from grpc layer to 
>> my application layer?
>>
>>
>> Now if I change my ManagedChannel to:
>>
>> NettyChannelBuilder builder =  NettyChannelBuilder.forAddress( host, port 
>> );
>> builder.eventLoopGroup( new NioEventLoopGroup(2) );
>> builder.directExecutor();
>>
>> 1) Will one of the event loop threads will do the work of user thread?
>>
>
> Yes.  The upside is that latency is less, (by about 25us) due to not 
> needing a thread hop.   The downside is that if you block in your 
> application work load, you run the risk of deadlock or very high latency 
> for other RPCs.
>  
>
>> 2) When I try this scenario, I see that a thread called 
>> *[grpc-default-executor-0] * is created. What does this thread intended 
>> to do?
>>
>
> That may be DNS resolver, as DNS resolution is a blocking operation in 
> java (we would love for this to be fixed!)
>  
>
>>
>> Thanks
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/1a2b41d4-9117-4a02-9ce4-98a5231569e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to