Yes, if you call ServerBuilder.executor()

On Thu, Dec 22, 2022 at 2:29 PM y <liuyaol...@gmail.com> wrote:

>
>
> On Thu, Dec 22, 2022 at 2:04 PM Sanjay Pujare <sanjaypuj...@google.com>
> wrote:
>
>>
>>
>> On Thu, Dec 22, 2022 at 1:47 PM y <liuyaol...@gmail.com> wrote:
>>
>>>
>>>
>>> If service a and service b are implemented on the same server, do they
>>> share the same thread pool?
>>>
>>
>> Yes. But you can provide a threadpool/executor per server :
>> ServerBuilder.executor()
>>
>
> I see. This means if I create two grpc servers in the same physical
> server, they can have different thread pools?
>
>
>>
>>
>>>
>>> On Thu, Dec 22, 2022 at 1:14 PM 'sanjay...@google.com' via grpc.io <
>>> grpc-io@googlegroups.com> wrote:
>>>
>>>>
>>>>>>> Wondering if there is limited token by default for auto flow
>>>>>>> control?
>>>>>>>
>>>>>>
>>>>>> I guess there has to be a limit for backpressure to work. Are you
>>>>>> asking if it's possible to change the token limit?
>>>>>>
>>>>> Yeah. I am asking what the limit is by default. If I want to change
>>>>> it, I have to do manual flow control I suppose?
>>>>>
>>>>
>>>> It is 1 : it asks for one more request-message after receiving a
>>>> message:  see
>>>> https://github.com/grpc/grpc-java/blob/master/stub/src/main/java/io/grpc/stub/ServerCalls.java#L266
>>>>
>>>>
>>>>
>>>>>
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> If not, say I have 20 threads, one rpc with 20 streams with blocking
>>>>>>> onNext()  will block 20 threads?
>>>>>>>
>>>>>>
>>>>>> One rpc is one stream. Unless you are saying there are 20 incoming
>>>>>> rpc instances of the same method in which case there will be 20 streams.
>>>>>> You are right: it will take up 20 threads.
>>>>>>
>>>>>>
>>>>> Sorry for the confusion. I meant for StreamingRPC. Say one rpc client
>>>>> (one rpc method) calls onNext() 10 times. and each onNext() for the rpc
>>>>> server side is blocking. How many threads will this rpc block?
>>>>>
>>>>
>>>> All messages in a streaming RPC are strictly sequential so it will take
>>>> only one thread on the server side. Unless a message is completely
>>>> processed the next message in the stream is not accepted for processing.
>>>>
>>>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "grpc.io" group.
>>>> To unsubscribe from this topic, visit
>>>> https://groups.google.com/d/topic/grpc-io/7LV3MC9Dwkg/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> grpc-io+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/grpc-io/d0de588d-ef5b-4fad-a735-5d513e4abaddn%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/grpc-io/d0de588d-ef5b-4fad-a735-5d513e4abaddn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CA%2BPad6gjywijC7FhR%2BENmpMP%2BQvexe0idM9UHhSUZtweKLy01A%40mail.gmail.com.

Reply via email to