Limit of number of websockets

zhkas
is there any limit on number of simultaneous websocket connection from one api token ?
As I am getting bad handshake after opening more than 25 websockets ?
or may its because of some kernel parameter on my system limiting this ?
  • rakeshr
    is there any limit on number of simultaneous websocket connection from one api token ?
    Yes, there is a maximum of 3 WebSocket connections allowed per API key. You can go through Websocket FAQs to know about WebSocket subscription limits.
    As I am getting bad handshake after opening more than 25 WebSockets ?
    Can you paste complete error trace-back for this?
    Also, can you reduce the maximum opened WebSocket connection to 3 and check?
  • zhkas
    You are saying that maximum of 3 WebSocket connections allowed per API key.
    but I am able to open 25 connections successfully
    It is the 26th connection which is resulting in bad handshake.

    Also, I need to subscribe whole F&O data for my strats to work which is around 50K tokens, and being 3K limit per web-socket, I need to open at-least 17 connections .

    While testing I tried to open more web-socket connections and was successful till 25 connections.

    So, what is the meaning of "maximum of 3 WebSocket connections allowed per API key" ?
  • pranksterguru
    i am just trying to understand.. what is the problem if we subscribe all the instruments in one websocket connection ?
  • sujith
    @zhkas,
    As stated in multiple queries or FAQs, we officially recommend you to use only 3 Websocket connections per api_key. For some legacy reasons, it might be working as of now but it can be changed soon without intimation. If you want to open more websocket connections, then you will have to subscribe for multiple Kite Connect apps.
  • zhkas
    zhkas edited September 13
    so,
    subscribing 50,000 tokens = 17 websocket connections = 6 apps = 12,000 ₹ per month

    isn't this too expensive ?
    "You can subscribe up to 3000 instruments/shares in a single WebSocket connection, and for one user you can have 3 WebSocket connection, so you can stream maximum of 9000 shares for one user. because all WebSockets will be independent of each other, there will be no cross-connection."

    From the above statement , it is limit per user and not api_key
    so, if lets say 6 users subscribed to my app, can I open 18 web-connection from same app but with 6 access_token ?
  • sujith
    @zhkas,
    The 3 connections limit is per api_key and not based on user. A Kite Connect app is enabled only for single user by default.
  • zhkas
    zhkas edited September 14
    ok , loot us

    so now you applied the limit on your legacy systems too, after I notified
    because today I am not allowed to even start 4 websockets
  • pranksterguru
    @zhkas ha ha.. you have made it impossible for others also now :)

    just curious to know, do you have powerful system that can handle 50000 ticks every second ? even if you are going to just print it, you will need super duper server.
Sign In or Register to comment.