Kite response has become way slower in the last week

samikprakash
samikprakash edited August 11 in Python client
I have been using the Kite API for the past month and last week I started noticing that the response is taking a lot longer than it was taking before. This is increasing my latency and other time-sensitive issues. Earlier I was satisfied with the response times. My internet connection is same as before so I am assuming that there is a problem from the server side and not on my side.

Facts: Internet speed around 10 MB/s
Average time taken to retrieve a quote - 7 seconds. (Which is a lot)
  • sujith
    We never recommend using Kite Connect for HFT or time based strategies. For how many instruments are you fetching the data and how often do you fetch the data? Is this consistent or intermittent?
  • Ramji
    @sujith hi sujith, even I am facing the same issue where the API response time has increased significantly in last week.

    My script has 'pd.DataFrame(kite.orders()["day"])' command to get the order dataframe and this is run at an interval of 5 mins intraday; it was getting the data within 1 sec till last week however now it takes upto 7-8 secs for certain runs. Similarly 'pd.DataFrame(kite.positions()["day"])' and some other calls taking upto 7-8 secs while running at 5 mins. Kindly note that I am not a techie and really appreciate your help!

    My strategy is to get nifty futures price at the end of each 5 mins and then placing options order on back of price based signals. I understand the latency while fetching historical prices but getting the orders, positions and placing the orders should be immediate?

    Also, just to know, you said above that kite connect should not be used for time based strategies. Isn't every trading strategy time based i.e. order should be executed immediately once the signal is generated?

    Thanks in advance!
    Ram


  • sujith
    @Ramji,
    We don't see any issue from our end. All the requests are completed within a second for me. Can you try on an alternate network?

    If your strategy can't afford to account for a couple of seconds delay then you need to go for colo setup at the exchange. Kite Connect isn't a suitable product for your use case. We can help you setup colo server at the exchange.
  • sujith
    It costs upwards 18lakhs/annum for colo setup. You can send an email to kiteconnect(at)zerodha.com and someone from the team will get back to you.
  • Ramji
    Thanks for your reply Sujith

    One more question - whenever an api response is delayed, lets say kite.orders took 7 secs, remaining all the calls (for ex - kite.positions) also have similar lag of 7 secs or so. Could there be an explainable reason for that?

    Note - when the api response is faster, all gets completed within a sec.

    Thanks,
    Ram
  • sujith
    A 7 seconds for completing a get API call is too much. I would suggest trying it on a different ISP. It is very unlikely that Kite Connect takes that much time, you can probably do a trace route at that time and post the details here.
  • Ramji
    Thank You Sujith, I will try that
  • sujith
    It could be because of connectivity issue between ISP and the Cloudlfare.
  • Ramji
    Ramji edited September 6
    Thanks, I am not exactly sure what is Cloudflare, was trying to read online. Is it related to ISP and should I try with diff ISP to fix it? If not, is there anyway I can address it? Thank You!
  • rakeshr
    Is it related to ISP and should I try with diff ISP to fix it? If not, is there anyway I can address it?
    We use Cloudflare as the CDN. If your internet service provider's (ISP's) DNS server has some connectivity issue with Cloudflare CDN, there can be a possibility of delayed response, etc. So, you should once check response timings in a different ISP.
  • Ramji
    Thanks Rakesh, I will run it in AWS to find out
  • DD1365
    @Ramji Run your code on AWS EC2 Linux instance, my code has been running daily and there has been no lag at all. I checked my log files for past 2-3 weeks, 'pd.DataFrame(kite.orders())' has been consistently generating 3 pings per second without any failure.
Sign In or Register to comment.