I am browsing some kx documents, and read from https://code.kx.com/q/wp/ipc/#unix-domain-socket, that " Using a UDS to communicate when processes are on the same machine will avoid some checks and operations in the TCP/IP protocol,". Does anyone know what was skipped during TCP establishing? Also, is there any drawback using unix domain hopen over regular TCP/IP, namely is h1 “faster and lighter” than h without sacrifice?
When it says it will “avoid some checks and operations” this is due to unix domain sockets (UDS ) avoiding things related to the tcp/ip stack (headers, routing, ) - the kdb+ code itself is the same for both. Tcp/ip loopback interface has gotten more efficient over the years, so its always worth benchmarking your particular use-case against both.
UDS buffers do not auto-tune, unlike tcp, and whilst setting the send buffer size can impact performance, setting the recv buffer has no impact - neither of these are settable from within kdb+ yet. This can impact performance where large data sets (that exceed the uds send buffer size) are being transferred between otherwise busy processes.