8

PSA: If you do reverse proxying stuff, prefer unix domain sockets over localhost internet sockets, if it's on the same machine (and if it's forwarded over ssh too). You can even serve HTTP as a unix socket.

Unix domain sockets don't have the overhead of IP, so generally speaking, data will flow to your other process with much less overhead.

I've recently stopped being lazy at this, and it's worth it.

Comments
  • 4
    It's also much more secure and has less potential for messing up.
  • 1
    If you're on a Linux box you could even use abstract namespace sockets. Dunno if it really the perf gain is noticeable - and it can be a bit nasty getting that null termination in at the *start* of the string, but I somehow like them. Even sad I can't use them on macOS.
  • 1
    For total newbs like me it may not be immediately useful, but it's a solid short and simple breakdown.

    Thanks for this post kescher.
Add Comment