[zeromq-dev] TCP vs IPC on common host
Chuck Remes
lists at chuckremes.com
Mon Jul 30 17:51:13 CEST 2012
On Jul 30, 2012, at 10:38 AM, Iggy Philly wrote:
>
> I'm trying to understand the differences between using TCP and IPC between processes on the same linux host. I've seen various indications that the TCP and IPC infrastructures are the same so I'm wondering if there is any significant performance difference between the two protocols on the same host machine. Does the TCP protocol still go through the network stack if both ends are on the same host? Or could I expect performance to be similar?
This is a great example of a question that could be answered by running the "perf" examples and trying out the different transports to see any differences.
That's the only way to get a good answer for your environment.
On Windows, IPC is *currently* handled by opening up a local TCP connection through loopback. However, that could change in a future release and result in a performance change.
Same is true for Linux; more recent releases have a highly optimized kernel code path for IPC than for TCP to the same host. Try it and see.
On OSX, IPC is handled via UNIX domain sockets so that the performance relative to TCP is pretty similar. Future releases of OSX may change this.
You will also see performance differences depending on the size of your messages and the transport choice. Try it and see for *your app.*
When doing any benchmarking, it's important that your test run for 30 or more seconds. Any "performance test" that completes in a few seconds will be dominated by startup & shutdown time and therefore give you bogus numbers, so make sure it runs longer.
cr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120730/e1fc4010/attachment.htm>
More information about the zeromq-dev
mailing list