Re: [grpc-io] Re: tcp connection management

2018-08-08 Thread eleanore . jin
Hi Eric, 

Thanks a lot! Yes I indeed create a new channel everytime for the unary 
call, after changing to use the same channel, I only see 1 tcp connection 
created. 


On Wednesday, August 8, 2018 at 9:47:53 AM UTC-7, Eric Gribkoff wrote:
>
> There should only be a single TCP connection when sending five unary 
> calls. Can you post a code sample of how you are testing this? It sounds 
> like you might be re-creating the gRPC channel for each call, which would 
> create a separate TCP connection for each RPC. You should create only one 
> channel, and use this to send multiple RPCs over the same TCP connection.
>
> Eric
>
>
> On Tue, Aug 7, 2018 at 4:22 PM > wrote:
>
>> BTW, I am using grpc-java
>>
>> On Tuesday, August 7, 2018 at 4:21:53 PM UTC-7, eleano...@gmail.com 
>> wrote:
>>>
>>>
>>> Hi, 
>>>
>>> I am doing an experiment to decide whether my application should choose 
>>> unary call, or bi-directional streaming. Here is what I observe by enable 
>>> the debug logging:
>>>
>>> for unary call, the tcp connection is created per call: 
>>>
>>> client side single thread making 5 calls in a for loop: total 5 tcp 
>>> connections - using blocking stub
>>> client side multi-threaded making 5 calls at the same time: total 5 tcp 
>>> connections - using block stub
>>> bi-directional streaming making 5 requests: total 1 tcp connection - 
>>> using async stub
>>>
>>> So that means for unary call, it will always create new tcp connection 
>>> every time? Can you please confirm this behaviour?
>>>
>>> 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+u...@googlegroups.com .
>> To post to this group, send email to grp...@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/1251d22f-547a-4888-9096-2d36ce1c5705%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/7c335d72-a996-45cb-ad03-41b47dfa5fef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [grpc-io] Re: tcp connection management

2018-08-08 Thread 'Eric Gribkoff' via grpc.io
There should only be a single TCP connection when sending five unary calls.
Can you post a code sample of how you are testing this? It sounds like you
might be re-creating the gRPC channel for each call, which would create a
separate TCP connection for each RPC. You should create only one channel,
and use this to send multiple RPCs over the same TCP connection.

Eric


On Tue, Aug 7, 2018 at 4:22 PM  wrote:

> BTW, I am using grpc-java
>
> On Tuesday, August 7, 2018 at 4:21:53 PM UTC-7, eleano...@gmail.com wrote:
>>
>>
>> Hi,
>>
>> I am doing an experiment to decide whether my application should choose
>> unary call, or bi-directional streaming. Here is what I observe by enable
>> the debug logging:
>>
>> for unary call, the tcp connection is created per call:
>>
>> client side single thread making 5 calls in a for loop: total 5 tcp
>> connections - using blocking stub
>> client side multi-threaded making 5 calls at the same time: total 5 tcp
>> connections - using block stub
>> bi-directional streaming making 5 requests: total 1 tcp connection -
>> using async stub
>>
>> So that means for unary call, it will always create new tcp connection
>> every time? Can you please confirm this behaviour?
>>
>> 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/1251d22f-547a-4888-9096-2d36ce1c5705%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CALUXJ7jS7X%2B0ngT4mkfGpJ%3DJ%2B-V7LzppOWnqN49KgQ4TFBs6Mw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[grpc-io] Re: tcp connection management

2018-08-07 Thread eleanore . jin
sorry what do you mean?

On Tuesday, August 7, 2018 at 4:31:34 PM UTC-7, pizzas...@gmail.com wrote:
>
> Bvfdc

-- 
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/5e8c8e96-3849-4209-837a-2b5a6e20ea70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[grpc-io] Re: tcp connection management

2018-08-07 Thread eleanore . jin
BTW, I am using grpc-java

On Tuesday, August 7, 2018 at 4:21:53 PM UTC-7, eleano...@gmail.com wrote:
>
>
> Hi, 
>
> I am doing an experiment to decide whether my application should choose 
> unary call, or bi-directional streaming. Here is what I observe by enable 
> the debug logging:
>
> for unary call, the tcp connection is created per call: 
>
> client side single thread making 5 calls in a for loop: total 5 tcp 
> connections - using blocking stub
> client side multi-threaded making 5 calls at the same time: total 5 tcp 
> connections - using block stub
> bi-directional streaming making 5 requests: total 1 tcp connection - using 
> async stub
>
> So that means for unary call, it will always create new tcp connection 
> every time? Can you please confirm this behaviour?
>
> 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/1251d22f-547a-4888-9096-2d36ce1c5705%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.