TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Using gRPC for (local) inter-process communication (2021)

121 pointsby zardinality6 months ago

14 comments

pjmlp6 months ago
&gt; Using a full-featured RPC framework for IPC seems like overkill when the processes run on the same machine.<p>That is exactly what COM&#x2F;WinRT, XPC, Android Binder, D-BUS are.<p>Naturally they have several optimisations for local execution.
评论 #42201053 未加载
评论 #42196335 未加载
评论 #42197280 未加载
评论 #42209092 未加载
jauntywundrkind6 months ago
I <i>super</i> dug the talk <i>Building SpiceDB: A gRPC-First Database - Jimmy Zelinskie, authzed</i> which is about a high-performance auth system, which talks to this. <a href="https:&#x2F;&#x2F;youtu.be&#x2F;1PiknT36218" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;1PiknT36218</a><p>It&#x27;s a 4-tier arhcitecture (clients - front end service - query service - database) auth system, and all communication is over grpc (except to the database). Jimmy talks about the advantages of having a very clear contract between systems.<p>There&#x27;s a ton of really great nitty gritty detail about being super fast with gRPC. <a href="https:&#x2F;&#x2F;github.com&#x2F;planetscale&#x2F;vtprotobuf">https:&#x2F;&#x2F;github.com&#x2F;planetscale&#x2F;vtprotobuf</a> for statical-size allocating protobuf rather than slow reflection-based dynamic size. Upcoming memory pooling work to avoid allocations at all. Tons of advantages for observability right out of the box. It&#x27;s subtle but I also get the impression most gRPC stubs are miserably bad, that Authzed had to go long and far to get away from a lot of gRPC tarpits.<p>This is one of my favorite talks from 2024, and strongly sold me.on how viable gRPC is for internal services. Even if I were doing local multi-process stuff, I would definitely consider gRPC after this talk. The structure &amp; clarity &amp; observability are huge wins, and the performance can be really good if you need it.<p><a href="https:&#x2F;&#x2F;youtu.be&#x2F;1PiknT36218#t=12m" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;1PiknT36218#t=12m</a> 12min is the internal cluster details.
评论 #42196318 未加载
palata6 months ago
I have been in a similar situation, and gRPC feels heavy. It comes with quite a few dependencies (nothing compared to npm or cargo systems routinely bringing hundreds of course, but enough to be annoying when you have to cross-compile them). Also at first it sounds like you will benefit from all the languages that protobuf supports, but in practice it&#x27;s not that perfect: some python package may rely on the C++ implementation, and therefore you need to compile it for your specific platform. Some language implementations are just maintain by one person in their free time (a great person, but still), etc.<p>On the other hand, I really like the design of Cap&#x27;n Proto, and the library is more lightweight (and hence easier) to compile. But there, it is not clear on which language implementation you can rely other than C++. Also it feels like there are maintainers paid by Google for gRPC, and for Cap&#x27;n Proto it&#x27;s not so clear: it feels like it&#x27;s essentially Cloudflare employees improving Cap&#x27;n Proto for Cloudflare. So if it works perfectly for your use-case, that&#x27;s great, but I wouldn&#x27;t expect much support.<p>All that to say: my preferred choice for that would technically be Cap&#x27;n Proto, but I wouldn&#x27;t dare making my company depend on it. Whereas nobody can fire me for depending on Google, I suppose.
评论 #42198651 未加载
评论 #42199866 未加载
zackangelo6 months ago
Had to reach for a new IPC mechanism recently to implement a multi-GPU LLM inference server.<p>My original implementation just pinned one GPU to its own thread then used message passing between them in the same process but Nvidia&#x27;s NCCL library hates this for reasons I haven&#x27;t fully figured out yet.<p>I considered gRPC for IPC since I was already using it for the server&#x27;s API but dismissed it because it was an order of magnitude slower and I didn&#x27;t want to drag async into the child PIDs.<p>Serializing the tensors between processes and using the Servo team&#x27;s ipc-channel crate[0] has worked surprisingly well. If you&#x27;re using Rust and need a drop-in (ish) replacement for the standard library&#x27;s channels, give it a shot.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;servo&#x2F;ipc-channel">https:&#x2F;&#x2F;github.com&#x2F;servo&#x2F;ipc-channel</a>
DashAnimal6 months ago
What I loved about Fuchsia was its IPC interface, using FIDL which is like a more optimized version of protobufs.<p><a href="https:&#x2F;&#x2F;fuchsia.dev&#x2F;fuchsia-src&#x2F;get-started&#x2F;learn&#x2F;fidl&#x2F;fidl" rel="nofollow">https:&#x2F;&#x2F;fuchsia.dev&#x2F;fuchsia-src&#x2F;get-started&#x2F;learn&#x2F;fidl&#x2F;fidl</a>
评论 #42196584 未加载
HumblyTossed6 months ago
&gt; Using a full-featured RPC framework for IPC seems like overkill when the processes run on the same machine. However, if your project anyway exposes RPCs for public APIs or would benefit from a schema-based serialisation layer it makes sense to use only one tool that combines these—also for IPC.<p>It <i>might</i> make sense. <i>Usually</i>, if you&#x27;re using IPC, you need it to be as fast as possible and there are several solutions that are much faster.
评论 #42195492 未加载
评论 #42195664 未加载
评论 #42198197 未加载
lyu072826 months ago
Cool that they mention buf, it&#x27;s such a massive improvement over Google&#x27;s own half abandoned crappy protobuf implementation<p><a href="https:&#x2F;&#x2F;github.com&#x2F;bufbuild&#x2F;buf">https:&#x2F;&#x2F;github.com&#x2F;bufbuild&#x2F;buf</a>
anilakar6 months ago
In addition to cloud connectivity, we&#x27;ve been using MQTT for IPC in our Linux IIoT gateways and touchscreen terminals and honestly it&#x27;s been one of the better architectural decisions we&#x27;ve made. Implementing new components for specific customer use cases could not be easier and the component can be easily placed on the hardware or on cloud servers wherever it fits best.<p>I don&#x27;t see how gRPC could be any worse than that.<p>(The previous iteration before MQTT used HTTP polling and callbacks worked on top of an SSH reverse tunnel abomination. Using MQTT for IPC was kind of an afterthought. The SSH Cthulhu is still in use for everyday remote management because you cannot do Ansible over MQTT, but we&#x27;re slowly replacing it with Wireguard. I gotta admit that out of all VPN technologies we&#x27;ve experimented with, SSH transport has been the most reliable one in various hostile firewalled environments.)
评论 #42196454 未加载
评论 #42204532 未加载
DanielHB6 months ago
At a project I worked at we were considering using protobuf for IPC between our desktop app and our network framework code which used different languages.<p>The performance was part of the reason (compared to serializing using JSON) but the main reason was just tooling support for automatic type checking. gRPC can generate types from a schema for all popular languages out there.<p>We ended up taking another route but I feel it is important to consider the existing tools ahead of any performance concerns for most cases
up2isomorphism6 months ago
This the typical situation where : “you can do it” doesn’t mean you should do it, and there is very little sense to advertise it, if at all.
justinsaccount6 months ago
&gt; In our scenario of local IPC, some obvious tuning options exist: data is exchanged via a Unix domain socket (unix:&#x2F;&#x2F; address) instead of a TCP socket<p>AFAIK at least on linux there is no difference between using a UDS and a tcp socket connected to localhost.
评论 #42198202 未加载
pengaru6 months ago
There&#x27;s a mountain of grpc-centric python code at $dayjob and it&#x27;s been miserable to live with. Maybe it&#x27;s less awful in c&#x2F;c++, or at least confers some decent performance there. In python it&#x27;s hot garbage.
评论 #42195747 未加载
评论 #42196845 未加载
评论 #42197041 未加载
评论 #42196231 未加载
评论 #42196568 未加载
jeffbee6 months ago
Interesting that it is taken on faith that unix sockets are faster than inet sockets.
评论 #42195489 未加载
评论 #42196345 未加载
评论 #42195458 未加载
评论 #42195960 未加载
评论 #42195476 未加载
kats6 months ago
Congrats and welcome to the 80s!