Kite API call takes more time than usual

krtrader
Hi @sujith

Recently I observed delay while getting response from kite API calls. I am using java client. Till 11th Dec 2018, placeOrder() api was taking time upto 150 ms but starting from 12th Dec, it takes more than 500 ms to get response back.

Could you please look into this? I can give you appropriate logs for this.

Have anyone else observed this?
  • HowUTrade
    @krtrader

    We are also experiencing this.
    Initially, thought this may be due to some temp network issues.

    But the delay is consistent, we hope Kite team might have added some delay in order requests.
    Earlier we used to place a order in ~50ms, now it takes more than 200ms (Mumbai data center).

    This delay started after (08-Dec-18) our comment posted here https://kite.trade/forum/discussion/comment/18571/#Comment_18571
  • krtrader
    Thanks @HowUTrade, at least I am not only one who is facing this issue.
    But I don't think Kite team would have added delay in order request. What could be the motive?

    @sujith @Kailash could you please give your inputs here? I am facing this issue starting from 12-Dec-2018
  • Vivek
    Vivek edited December 2018
    @krtrader @HowUTrade Is your server hosted on AWS? We noticed increased latency from AWS to Cloudflare around 12th Dec and reported it to AWS and Cloudflare team. They confirmed something wrong with AWS India network which connects to Cloudflare.
  • HowUTrade
    @Vivek

    Yes, We are using AWS only.
    Region: Mumbai
    EC Type: C4 Large

    Earlier used place to order in 30-50ms,
    now it takes 180-250ms
  • krtrader
    Hi @Vivek ,

    Yes, I am also using AWS Mumbai (Availability zone ap-south-1a)
    Is this issue reported to AWS and cloudflare team from your side?

    The problem started from 12th Dec
  • Vivek
    Yeah It's reported to both AWS and Cloudflare and AWS admitted that there is some network issue with outgoing to Cloudflare with their network provider VSNL. Here is the response from AWS team
    From my internal tooling I can confirm that there has been network connectivity issues to the outside internet, and your findings are valid. I see that our internal service teams are in the process investigating this issue and providing a fix.
  • krtrader
    Thanks @Vivek , please keep us updated once you get response from AWS team
  • tejasvgupta1
    @HowUTrade how are you taking care of auto login to kite api for daily access token?
  • sujith
    @tejasvgupta1,
    It is mandatory by the exchange that a trader has to log in manually at least once a day. We don't recommend automating login.
  • tejasvgupta1
    @sujith I understand that but manual login and request token are somewhat different, for example I can login from mobile but not change request token so in that way exchange rule is also followed login daily manually without the need to require new request token
  • krtrader
    Hi @Vivek

    I am still observing latency while calling API. Is the issue from AWS end still not resolved?

    Hi @HowUTrade, are you still facing the same issue?
  • HowUTrade
    Yes, @krtrader

    We temporarily switched to Digital-ocean-Bangalore data-center where we are getting ~90ms latency for order requests.
  • krtrader
    Thanks @HowUTrade

    @Vivek which would be best data-center for minimum latency to connect to Kite servers?
  • krtrader
    @Vivek , would appreciate your inputs
  • krtrader
    @HowUTrade seems AWS issue is resolved.
  • enliyo
    I measured the response time of Kite APIs for a server hosted in Digital Ocean Bangalore and seems that the APIs are very slow taking 150-250ms to respond back. My computer to Digital Ocean connectivity is extremely fast i.e. <20ms so it is definitely something between Digital Ocean and Kite AP or API itself being too slow.

    Looks like it is Kite API which are very slow and as a result my custom app feels sluggish. I am have not measured the websocket streaming performance.

    For me order placement and execution has to be fast. Do you guys know what are there KPIs for APIs? 200ms is definitely slow in my books.
  • sujith
    Hi @enliyo,
    We have enough bandwidth allocated at AWS and Cloudflare. I think it has something to do with the connectivity between Digital ocean and AWS/Cloudflare.
    I would suggest raising a ticket with Digital ocean.
  • enliyo
    @sujith sure.

    Others how is your typical API response times now? If hosted, where are hosting your servers? AWS?
  • krtrader
    Hi @Vivek , @sujith

    We have started facing same issue again. Earlier placeOrder API was taking around 150 ms but now it takes more than 500 ms since 03-APR-2019

    I am using AWS Mumbai server. Last time you mentioned that there was increased latency from AWS to Cloudflare. Could you please check if the same issue occurred again?

    cc @HowUTrade
  • sujith
    If this is a consistent issue then, can you send the traceroute? We raise the issue with Cloudflare.
  • sujith
    It seems like a collision between your ISP and our networks.
  • krtrader
    what's the solution for this? @sujith
    Will it be resolved automatically?
  • krtrader
    If this is a consistent issue then, can you send the traceroute?
    Last time I faced similar issue from 12 Dec 2018 to 1st week of Jan 2019. @Vivek reported this to aws and cloudflar I guess.

    This time I am facing this since 3rd April consistently. I think you can check once with aws or cloudflar for this please @sujith
  • sujith
    We need to attach information while raising the ticket. Since we haven't observed this now. We need a traceroute logs.
  • krtrader
    Hi @sujith

    I have sent you traceroute logs in the inbox. Check once please. This problem is consistent
  • krtrader
    Hi @sujith

    The problem still not resolved. please help
  • enliyo
    I am observing the same issue. From my home computer the /positions API takes ~150ms. While from the AWS hosted server the same call takes 700-1500ms times, earlier it used to complete within 50-100ms. That is 15x performance degradation.

    If it helps, I am using lightsail AWS server.
  • Vivek
    @krtrader @enliyo We can verify the issue with increased latency. Its seems like issue with AWS Mumbai outgoing network traffic and we are reporting this to AWS team. Will post further updates here.
  • krtrader
    Thanks @Vivek,

    It this same issue that u reported last time?
  • krtrader
    The problem is resolved. Thanks @Vivek @sujith for the help
This discussion has been closed.