-
Notifications
You must be signed in to change notification settings - Fork 73
gRPC Roundtrip Latency Jitter on LVRT #235
Description
I'm experiencing jitter in roundtrip latency of gRPC calls while running on LabVIEW RT. I've been able to isolate that this jitter is not coming from my specific application (the jitter happens in a very simple example) and would like to understand if this is expected behavior and where this jitter may be coming from.
I have set up a gRPC server with a single server, which has 4 methods to it. Each method does practically nothing, other than returning a current timestamp. I then have set up a parallel loop to the gRPC server which performs a call to these 4 gRPC methods repeatedly. I'm measuring the time of the unary client call while both calling a single method and while calling all 4 methods in parallel. In this fashion, both the server and client are running under LabVIEW RT (on a PXIe-8881 controller) and the client is communicating with the server on localhost (so a physical Ethernet connection is not used).
When iterating over a single gRPC client method call, jitter is reduced, but I still see 'spikes' in the roundtrip call latency. Here is a graph for calling 1 gRPC client call every 10 msec for 2 minutes:

The 'spikes' are exacerbated when calling all 4 methods in parallel. In this graph, the roundtrip time is the time it takes for all 4 methods to return:

I've also tried reducing the interval period of sending these commands. In this graph, I'm sending 4 gRPC client calls in parallel, but at 100 msec intervals (for 20 minutes):

While running on Linux RT and using a localhost connection, I'd expect more deterministic results. Can you help confirm where the latency jitter is coming from?
I have uploaded all of my code that generated these results here: https://github.com/kt-jplotzke/grpc-labview-timingdemo
For reference, I am using the latest grpc-labview release v1.0.0.1.