[WIP/RFC v4 0/5] Support abstract Unix sockets
Maxim Dounin
mdounin at mdounin.ru
Fri Sep 2 21:11:24 UTC 2022
Hello!
On Fri, Sep 02, 2022 at 10:31:27PM +0200, Alejandro Colomar wrote:
> On 8/24/22 18:00, Maxim Dounin wrote:
> > I would rather say "it's a common misconception that it's faster
> > to communicate through Unix sockets". While it Unix sockets can
> > be beneficial for some microbenchmarks, in most production setups
> > it makes no difference, yet used to introduce various issues.
[...]
> I think these numbers are enough to make some users go for UDS instead
> of localhost if it's possible. Also, I think my test is mostly
> measuring the latency of the sockets, but throughput should be even more
> different between UDS and localhost, from what I've read. Of course, if
> the app is slow, the socket might not be the bottleneck, but from what
> I've tested, unit is fast enough so that socket speed is still
> measurable, so fast apps may legitimately want UDS to pair with them.
To re-iterate:
While Unix sockets can be beneficial for some microbenchmarks, in
most production setups it makes no difference, yet used to
introduce various issues.
Your tests reveal minor difference in yet another microbenchmark,
effectively testing connection costs. Connection costs are
usually negligible compared to the real work being done by real
applications, and yet can be reduced to nearly zero by using
keepalive connections.
--
Maxim Dounin
http://mdounin.ru/
More information about the nginx-devel
mailing list