If your workload is CPU intensive then you should pre-fork your 
subprocesses and have each one start their own gRPC server. gRPC-Python 
does not support forking after the server is created. If your workload is 
not CPU intensive (i.e., subprocesses/threads block on I/O frequently) then 
using ThreadPoolExecutor should scale fine.

On Wednesday, July 25, 2018 at 10:43:34 PM UTC-7, [email protected] wrote:
>
> Does gRPC Python support multicore use case now ? 
> We are using t2.xlarge instance types for our python grpc server , it is 
> also running on kubernetes .
> this is our resource request 
>  "requests": {
>       "cpu": "1800m",
>       "memory": "3584Mi"
>  }
> we would like to know can we utilize the requested cpu to the fullest .
> here the grpcio version we use
>
> grpcio==1.13.0
> grpcio-tools==1.11.0
>
>
> On Thursday, September 28, 2017 at 7:28:33 AM UTC+8, Nathaniel Manista 
> wrote:
>>
>> On Wed, Sep 27, 2017 at 8:18 AM, Gyuseong jo <[email protected]> wrote:
>>
>>> [gRPC Python] seems to use only single core.
>>>
>>
>> How many cores do you think it should use? How familiar are you with 
>> Python's 
>> Global Interpreter Lock (GIL) 
>> <https://wiki.python.org/moin/GlobalInterpreterLock>? How likely do you 
>> think it is that the single-core use that you're seeing is due to Python's 
>> GIL? What about your code is written suggests that it should be using more 
>> than one core? If you take gRPC "out of the experiment" and just exercise 
>> your service-side application code alone in a single Python interpreter, do 
>> you see it take advantage of multiple cores?
>>
>> We've got some work planned for the future to better support multicore 
>> Python use cases, but for now gRPC Python is GIL-limited in most scenarios.
>> -Nathaniel
>>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/06392ed3-7cba-4666-9d7a-4fc849a859b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to