Search code examples
javakdb+tickerq-langexxeleron-q

How to publish to KDB Ticker Plant from Java effectively


We have market data handlers which publish quotes to KDB Ticker Plant. We use exxeleron q java libary for this purpose. Unfortunately latency is quite high: hundreds milliseconds when we try to insert a batch of records. May you suggest some latency tips for KDB + Java binding, as we need to publish quite fast.


Solution

  • There's not enough information in this message to give a fully qualified response, but having done the same with Java+KDB it really comes down to eliminating the possibilities. This is common sense, really, nothing super technical.

    • make sure you're inserting asynchronously
    • Verify it's exxeleron q java that is causing the latency. I don't think there's 100's of millis overhead there.
    • Verify the CPU that your tickerplant is on isn't overloaded. Consider re-nicing, core binding, etc
    • Analyse your network latencies. Also, if you're using Linux, there's a few tcp tweaks you can try, e.g. TCP_QUICKACK
    • As you're using Java, be smarter about garbage collection. It's highly configurable, although not directly controllable.
    • if you find out the tickerplant is the source of latency, you could either recode it to not write to disk - or get a faster local disk.

    There's so many more suggestions, but the question is a bit too ambiguous.

    EDIT Back in 2007, with old(ish) servers and a very old version of KDB+ we were managing an insertion rate of 90k rows per second using the vanilla c.java. That was after many rounds of the above points. I'm sure you can achieve way more now, it's a matter of finding where the bottlenecks are and fixing them one by one.