3 ms·
>It has been many years since i tested this but unix sockets seemed slower to me than loopback TCP even They're essentially the same... except they're not and
by chmod775 4y ago
>It has been many years since i tested this but unix sockets seemed slower to me than loopback TCP even
They're essentially the same... except they're not and there's a boatload of work in the middle that doesn't need to be done for unix domain sockets.
I can imagine some edge-cases however, where differences in stacks and configuration (in/out buffers vs. shared buffers, buffer sizes, packet loss vs. reliable, locking, blocking vs. non-blocking writes) may lead to more optimal scheduling under concurrent workloads. As soon as you have more than one thread doing something, there's a boatload of moving parts to consider.
But if you have everything properly tuned, unix domain sockets should win every time. If your results said something else, you probably weren't benchmarking what you thought you were benchmarking.