As per the documentation, with one API key we can have up to 3 WebSocket connections, and each connection can receive ticks for up to 3000 instrument tokens.
I am building a tick collector that subscribes to all NSE instruments, using kite connect python client. When I distribute the instruments across 3 WebSocket connections, each connection ends up subscribing to slightly more than 3000 instruments.
Despite this: • There are no subscription errors • No warnings or disconnects • Ticks appear to be flowing normally
This makes me want to understand the actual runtime behavior of the limit: 1. Is the 3000 instrument limit per WebSocket a hard limit or a soft limit? 2. If a connection subscribes to more than 3000 tokens, will Kite silently drop ticks for some instruments? 3. If ticks are dropped, is it deterministic (same instruments always affected) or non-deterministic under load? 4. Is there a recommended safe buffer (e.g., staying below 2900) to ensure no data loss?
My primary concern is data correctness — I want to be certain that I am not missing ticks without any indication, since there are no explicit errors.
Would appreciate clarification from the Kite team or anyone running large-scale tick collectors.
For optimal performance and stability, it is recommended to subscribe to fewer than 3,000 instruments per WebSocket connection. You can open up to three WebSocket connections per API key, with each connection handling subscriptions for a maximum of 3,000 instrument tokens.
If a subscription request exceeds the 3,000-instrument limit on a single connection, the API will return an error for the additional tokens. However, the existing WebSocket connection will remain active and unaffected. While there is no hard-enforced limit on the total number of WebSocket connections, a soft limit is in place. Exceeding reasonable usage thresholds may result in your application being flagged, which could lead to suspension.
@salim_chisty "While there is no hard-enforced limit on the total number of WebSocket connections, a soft limit is in place". Does this mean i can have more than 3 websockets per api key? Is the limit different for all zerodha users?
If a subscription request exceeds the 3,000-instrument limit on a single connection, the API will return an error for the additional tokens. However, the existing WebSocket connection will remain active and unaffected. While there is no hard-enforced limit on the total number of WebSocket connections, a soft limit is in place. Exceeding reasonable usage thresholds may result in your application being flagged, which could lead to suspension.
You may refer to the similar discussion here.