Using gRPC for (local) inter-process communication
Posted by ketralnis@reddit | programming | View on Reddit | 6 comments
Posted by ketralnis@reddit | programming | View on Reddit | 6 comments
pftbest@reddit
There is a big problem with gRPC in practice, it's using Wall Time for all its Deadlines and Timeouts instead of Monotonic time, which any normal library would use. It is designed this way to run in a server environment and allow sharing deadlines/timeouts between servers. It assumes that your date/time is the same on all endpoints, is stable and won't change during operation.
However, if you are going to use gRPC as an IPC on a client machine and the user decides to adjust the clock, or even more common case your program was running on a system without internet connection and then it later was connected to the internet and NTP service fired adjusting your local clock.
Suddenly your gRPC has a high chance to lock up and get stuck at any random point waiting for a delay which is 5 days in the future, or your calls suddenly fail because their deadline is now in the past.
3141521@reddit
I've never had ash issue with this
Southern-Reveal5111@reddit
It is a very nice article, thanks for sharing with us.
Have you looked into why gRPC performs faster when the client and server run on separate cores, but slows down when they run on the same core?
ChannelSorry5061@reddit
Shouldn’t that be obvious? Sharing resources vs having their own…
Dekarion@reddit
Imagine you were going to share lunch at a table but there's only one chair and you can only eat while sitting down. Having the table to put the food on might add convience but not speed due to the time spent having to take turns with using the chair.
ExtensionThin635@reddit
Interesting I will say I don’t understand it fully which is a good thing, my initial naive approach is to use multiple threads and processes, using channels to communicate and join when needed.
The one caveat is, an actual product with components and services developed by separate teams with components needed to communicate. That I could def see a good use case and seems what you all did.