KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ drawback of using unix dmain

  • drawback of using unix dmain

    Posted by aele on January 21, 2024 at 12:00 am

    Hi kx community,

    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?

    h:hopen `::1500

    h1:hopen `:unix//1500



    aele replied 3 months, 1 week ago 2 Members · 2 Replies
  • 2 Replies
  • megan_mcp

    January 22, 2024 at 12:00 am

    Hi ,

    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.

    Hope this helps!



  • aele

    January 23, 2024 at 12:00 am

    thanks for the explanation.


Log in to reply.