Re: [protobuf] How can I make python sync calls and streaming responses faster?

143 views
Skip to first unread message

Feng Xiao

unread,
May 14, 2016, 7:30:30 PM5/14/16
to Yan Yan, grp...@googlegroups.com, Protocol Buffers
+grpc group

On Fri, May 13, 2016 at 8:46 PM, Yan Yan <lamh...@gmail.com> wrote:

I performed benchmarks by modifying the python examples. I have got 260/sec sync calls (req & rep rpc) and 1900/sec streaming response. How can I increase the thruput without multithreading and increase batch sizes? Thx.

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Jan Tattermusch

unread,
May 14, 2016, 11:10:07 PM5/14/16
to lamh...@gmail.com, Nathaniel Manista, grpc.io, prot...@googlegroups.com, Feng Xiao
Yes, we are aware of this problem and we are working hard to address this. Significant performance improvement for gRPC Python is coming soon.

Jan

On Sat, May 14, 2016 at 6:11 PM, <lamh...@gmail.com> wrote:
python sync call 260 time/sec
python streaming response 1900 times/sec
cpp sync call 9k times/sec
cpp streaming response 360k times/sec

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/c548d590-efb2-417b-8d80-27d1a2abf2da%40googlegroups.com.

Nathaniel Manista

unread,
May 15, 2016, 2:31:37 AM5/15/16
to Feng Xiao, Yan Yan, grp...@googlegroups.com, Protocol Buffers
On Sat, May 14, 2016 at 4:30 PM, 'Feng Xiao' via grpc.io <grp...@googlegroups.com> wrote:
+grpc group

On Fri, May 13, 2016 at 8:46 PM, Yan Yan <lamh...@gmail.com> wrote:

I performed benchmarks by modifying the python examples. I have got 260/sec sync calls (req & rep rpc) and 1900/sec streaming response. How can I increase the thruput without multithreading and increase batch sizes?

You question comes at just the right time - we've been concerned with gRPC Python performance for the last few months and will be finishing some dramatic improvements in the next few weeks. Issue 5594 will remain open until this work is integrated.
-Nathaniel

Yan Yan

unread,
May 16, 2016, 11:55:49 PM5/16/16
to grpc.io, lamh...@gmail.com, nath...@google.com, prot...@googlegroups.com, xiao...@google.com
ty

Yan Yan

unread,
Jul 14, 2016, 9:46:23 PM7/14/16
to grpc.io, xiao...@google.com, lamh...@gmail.com, prot...@googlegroups.com
I have got 7k/sec streaming response on python client. Is this expected? Thx.
rpc ListFeatures(Rectangle) returns (stream Feature) {}

Nathaniel Manista

unread,
Jul 14, 2016, 9:53:29 PM7/14/16
to Yan Yan, grpc.io, Protocol Buffers
On Thu, Jul 14, 2016 at 6:46 PM, Yan Yan <lamh...@gmail.com> wrote:
I have got 7k/sec streaming response on python client. Is this expected?

We haven't yet set up a comparable benchmark for single-RPC streaming, so it's neither expected nor unexpected. On what hardware are you running, and what version of grpcio do you have installed?
-N

Yan Yan

unread,
Jul 14, 2016, 11:53:36 PM7/14/16
to grpc.io, lamh...@gmail.com, prot...@googlegroups.com
grpcio-0.15.0
cpu is i5-6600
cpu utilization 156% python route_guide_client.py
cpu utilization 121% python ./route_guide_server.py

7k/sec streaming response is already much better than 1.9k/sec 2 months ago ^_^ 
i have made the ListFeature() method yielding the same thing over and over. 

How could I run the stuff here?

I have noticed some people in the forum reporting latency and percentiles. How could I run those benchmarks? Thx.

Yan Yan

unread,
Jul 22, 2016, 11:05:15 AM7/22/16
to grpc.io, lamh...@gmail.com, prot...@googlegroups.com
7k/sec streaming response still a little slow in my use cases. Can I do the grpc and protobuf stuff in c++ and integrate it with a python client? It is a user requirement that the client has to be in python. Has anyone tried grpc, protobuf, plus some of the stuff in the thread below? I would expect the python and c++ code to be running within the same process w/o IPC. Thx.

Integrate Python And C++


On Friday, July 15, 2016 at 9:53:29 AM UTC+8, Nathaniel Manista wrote:

Nathaniel Manista

unread,
Jul 28, 2016, 5:02:32 PM7/28/16
to Yan Yan, grpc.io, Protocol Buffers
On Fri, Jul 22, 2016 at 8:05 AM, Yan Yan <lamh...@gmail.com> wrote:
7k/sec streaming response still a little slow in my use cases. Can I do the grpc and protobuf stuff in c++ and integrate it with a python client?

Yes.

It is a user requirement that the client has to be in python.

Depending on your use case, it may be that the best way to maximize performance may be to write as much as possible in C++ and deliver to your Python-requiring user as high-level a Python API as possible. No matter what efficiencies we find and improvements we make in our Python code I'm dubious that it will ever be as performant as behaviorally-equivalent C++.

What can you share about the API you need to deliver in Python?
-Nathaniel
Reply all
Reply to author
Forward
0 new messages