A great puzzle of grpc-go

56 views
Skip to first unread message

Lei YiXing(北京研发中心)

unread,
Jul 2, 2017, 11:16:58 AM7/2/17
to grp...@googlegroups.com

Hellodear,

       Recently I used grpc-go in my project. But in stress testing, I found the throughput was very low and the response time was very long.

       Could you help me analyse the reason of this ? I am very confuseing and don’t know what I should do.

       I’m truly grateful for your help.

       Look forward to your soonest reply.

       Best Regards,

                                                                             Ethan Lei

 

 

       My grpc-server init like this:

// Register Services to RPC
server := grpc.NewServer(grpc.MaxMsgSize(1024*1024*500), grpc.MaxSendMsgSize(1024*1024*500))
grpcProto.RegisterVideoServiceServer(server, &VideoServiceImpl{})
// Register reflection service on gRPC server.
reflection.Register(server)

      

       My grpc-client caller like this:

ctx := context.TODO()
conn2videoInfoService, err = grpc.DialContext(ctx, videoInfoServerAddress, grpc.WithInsecure(), grpc.WithMaxMsgSize(1024*1024*500))

videoServiceClient = grpcProto.NewVideoServiceClient(conn2videoInfoService)

 

       And when testing ,my server cpu and memory status like this:

      

 

       And Test Data like this:

      

       e.g. :       269.4 / s means throughput per second

                     Avg means the average value of response time (millsecond)

                     Min means the min value of response time (millsecond)

                     Max means the max value of response time (millsecond)

                     Active and Started means the num of thread

 

 

 

Carl Mastrangelo

unread,
Jul 5, 2017, 3:39:48 PM7/5/17
to grpc.io, yixi...@sohu-inc.com
Have you tried profiling your code yet?  There is a blog post explaining how to do it for Go: https://blog.golang.org/profiling-go-programs
Reply all
Reply to author
Forward
0 new messages