Ticker data is much slower then Zerodha web portal

nameisbk
Hi folks,

I did implement ticker in .net core 3.1 where I subscribed for 310 instruments, so when I compare ticker updates for each instrument with Zerodha web portal and found that I'm not getting updates at the same time when web portal did so basically it is way much late the data updates but when I tried to pass 120 instruments it works fine. Did I miss anything here or how quickly I can get ticker tick with updated data the same as the Zerodha web portal? How many instruments I can pass in connection, I guess 1000 per one connection right?

Can someone please help me here.

Many thanks,
B K
Tagged:
  • sujith
    You need to make sure you are not blocking the main thread where ticks are received. You need to offload all the tasks to secondary thread and only listen to incoming ticks on the primary thread.
  • nameisbk
    @sujith How did I checked that Ticker is on the main thread and other task is on the secondary thread? so sorry for the question but I'm new to that so.
  • tonystark
    @nameisbk By default ticker is in main thread. If you are processing the data then you can do that in a different thread.
  • nameisbk
    @tonystark I checked thread in which ticker is running which is the main thread and I'm not doing any fancy thing apart from just consume data from ticker and sent it using SignalR still data seems way slower as compare to Zerodha web but when I pass approx. 100 token it seems good and there is no difference in pricing in my local as compare to Zerodha web but when I pass more then 200 tokens it rise this issue to me.

    Hope I explain to you properly.
  • tonystark
    So where are you observing the lag? Is it at SignalR client or at the server? It could be an overhead from SignalR too. In that case you might have to switch to something even lower level like WebSockets, which is used in all our systems including the ticker.

    Try logging the ticks at server and see if there is a lag there. Also maintain a good quality internet connection. If you are observing lags it is most usually at the data transfer mechanisms. Data will be around 200 tokens * 200 bytes = ~40KB. Which is not much to cause a lag at the software level.

    You can also run the Ticker instance in a different thread and see if that helps if you think it is really ticker that is causing the problem.
  • nameisbk
    @tonystark I observed it in SignalR server-side where I received tick but I'll definitely look around to replace SignalR with lower level websocket to try it along with internet connection as per maths you provide. I'll come back shortly with my review.

    Many thanks for your time and details explanation.
This discussion has been closed.