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.

Container-to-Container Communication

80 pointsby mikethemanover 3 years ago

13 comments

KaiserProover 3 years ago
Normally I&#x27;m all for people using tried and tested primitives for things, however I think that in this case unix sockets are probably not the right choice.<p>Firstly you are creating a hard dependency for having the two services sharing a same box, with a shared file system (that&#x27;s difficult to coordinate and secure.) But also should you add a new service that <i>also</i> want to connect via unix socket, stuff could get tricky to orchestrate.<p>But this also limits your ability to move stuff about, should you need it.<p>Inside a container, I think its probably a perfectly legitimate way to do IPC. Between containers, I suspect you are asking for trouble.
评论 #29718711 未加载
评论 #29722058 未加载
snicker7over 3 years ago
Doesn&#x27;t 700 requests per second for such a trivial service seem kinda slow?
评论 #29717434 未加载
评论 #29719213 未加载
评论 #29718155 未加载
Jhstoover 3 years ago
Bit besides the point, but how many of you do still run nginx inside container infrastructures? I&#x27;ve been having container hosts behind a firewall without explicit WAN access for a long time -- to expose public services, I offload the nginx tasks to CloudFlare by running `cloudflared` tunnel. These &quot;Argo&quot; tunnels are free to use, and essentially give you a managed nginx for free. Nifty if you are using CloudFlare anyway.
评论 #29719291 未加载
评论 #29720785 未加载
jantoover 3 years ago
<a href="https:&#x2F;&#x2F;zeromq.org&#x2F;get-started&#x2F;" rel="nofollow">https:&#x2F;&#x2F;zeromq.org&#x2F;get-started&#x2F;</a>
shipitover 3 years ago
I think this is where `gRPC` shines. It can <i>feel</i> tedious but really, define the interface and use the tooling to generate the stubs, implement and done. It prevents having to think up and implement a protocol and importantly versioning for if&#x2F;when the features of the containerized apps start to grow&#x2F;change.
3npover 3 years ago
The results are only relevant for AWS ECS Fargate due to the specifics of how they do volumes and CNI.
评论 #29726377 未加载
astreaover 3 years ago
The multiple layers of abstraction in this make this test sorta moot. You have the AWS infra, the poor MacOS implementation of Docker, the server architecture. Couldn&#x27;t you have just had a vanilla Ubuntu install and curl some dummy load n times and get some statistics from that?
评论 #29718175 未加载
2OEH8eoCRo0over 3 years ago
<a href="https:&#x2F;&#x2F;podman.io&#x2F;getting-started&#x2F;network" rel="nofollow">https:&#x2F;&#x2F;podman.io&#x2F;getting-started&#x2F;network</a><p>&gt; By definition, all containers in the same Podman pod share the same network namespace. Therefore, the containers will share the IP Address, MAC Addresses and port mappings. You can always communicate between containers in the same pod, using localhost.<p>I&#x27;m a noob here but why wouldn&#x27;t you use IPC?<p><a href="https:&#x2F;&#x2F;docs.podman.io&#x2F;en&#x2F;latest&#x2F;markdown&#x2F;podman-run.1.html#sharing-ipc-between-containers" rel="nofollow">https:&#x2F;&#x2F;docs.podman.io&#x2F;en&#x2F;latest&#x2F;markdown&#x2F;podman-run.1.html#...</a>
评论 #29720108 未加载
评论 #29719421 未加载
rcarmoover 3 years ago
I’m curious as to whether the HTTP requests re-used the TCP socket or if they were dumb “Connection: close” ones that closed the socket and set up a new one for each request.<p>The overhead for that alone would outstrip any benefits.
评论 #29719499 未加载
touisteurover 3 years ago
Isn&#x27;t this what a socket library like zeromq is supposed to cover? Change transports (tcp, ipc, inproc if in the same process, udp with radio&#x2F;dish,...) through config files, when deploying?
touisteurover 3 years ago
I&#x27;m plugging this amazing resource (not only containers but also virtual machines...): <a href="https:&#x2F;&#x2F;developers.redhat.com&#x2F;blog&#x2F;2018&#x2F;10&#x2F;22&#x2F;introduction-to-Linux-interfaces-for-virtual-networking" rel="nofollow">https:&#x2F;&#x2F;developers.redhat.com&#x2F;blog&#x2F;2018&#x2F;10&#x2F;22&#x2F;introduction-t...</a><p>It&#x27;s lower lever than OP but might give ideas.
revelover 3 years ago
There were a few other combinations I wanted to see -- how does docker-to-docker compare with socket communication on the same local machine? I would love to know if there&#x27;s a difference.<p>The results when running on other machines could be impacted by a number of different factors. Almost impossible to know what is limiting performance without deep diving into the logs
评论 #29721429 未加载
Klasiasterover 3 years ago
No talk about permissions, I think locking down access is also an interesting aspect of Unix Domain Sockets compared to TCP sockets.
评论 #29718749 未加载
评论 #29723105 未加载
评论 #29720212 未加载
评论 #29719662 未加载