Advice on how to cut latency when calling onNext()

29 views
Skip to first unread message

Rio Zhu

unread,
Nov 2, 2021, 7:21:42 PM11/2/21
to grpc.io
Hi All,

I'm having a bi-direction streaming service, the client is written in Java while the server is in C++. Both client and server side use the async gRPC APIs. Also, each channel, when created, sends a dummy message to the server, as a warmup.

I have noticed that, after warmup, when calling requestObserver.onNext() on the client side, the first few calls will take ~15 ms, and after that, it takes less time, which is <= 2ms. 

I'm wondering what is a good way to cut that inital latency so that it takes no more than 2 ms, just like the following calls?

Also, is it normal for onNext to take around 2ms to execute?

Thank you very much for your time and help.

Rio

Reply all
Reply to author
Forward
0 new messages