Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relatively high latency spikes when streaming messages to a client on the same machine #2463

Open
jakupj opened this issue Jun 11, 2024 · 0 comments
Labels
question Further information is requested

Comments

@jakupj
Copy link

jakupj commented Jun 11, 2024

I'm using grpc to stream messages from a service to a client on the same machine. I expect it to have pretty low latency, ie sub millisecond. For the most part it does, however I'm seeing very high spikes in latency.

I wrote a simple test client/server to test grpc steaming latency src here: https://github.com/jakupj/GrpcTesting

Latency is determined by timestamping the message at the service just before sending it the the client and then timestamping on the client. For the most part, ie the 99th percentile I'm seeing sub 1ms latency. However I do see extremely high spikes in latency ie 30ms and over.

I've tried all the suggestions in the performance docs, even setting the gc to SustainedLowLatency mode, with no effect. Tried it on two different machines, one a Windows 11 system and another Windows server 2022 with no difference. My suspicions are that it might be GC related.

I've also tried running the serverstreaming benchmarks in the grpc-dotnet repo, I'm seeing similar results of high max latency there too.

My requirements are to stream messages to clients on the same machine with peaks around 5,000 or so messages per second with sub millisecond consistently.

Is there something I'm missing, a configuration setting maybe, am I doing it correctly? Or should I be looking at another solution, maybe signalR instead?

Thanks

@jakupj jakupj added the question Further information is requested label Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant