I’m using a WebSocket connection and have subscribed to 500 tokens. Frequently, I notice a latency of 5–6 seconds between two consecutive ticks for a given token. Is there a way to reduce this latency?
Some possible causes I’m considering: 1. Server-side throttling due to the high number of subscriptions 2. Client-side bottlenecks in processing the incoming stream 3. Network congestion or packet loss 4. Batching or queuing delays on the provider’s end
What are the recommended strategies to improve performance in this case? For example: 1. Should I split subscriptions across multiple WebSocket connections? 2. Is there an optimal limit to the number of tokens per connection? 3. Are there known techniques (e.g., compression, parallel processing, efficient message handling) that help minimize tick-to-tick latency?
You can subscribe to up to 3000 instruments in a WebSocket connection. The number of ticks that you receive depends on the subscription mode; refer to this discussion here for more details.
Also, this could happen if you are blocking the ticker(which leads to missing ticks) or not storing/dumping tick data properly in file or DB. You can try out this example to check the same.
Also, this could happen if you are blocking the ticker(which leads to missing ticks) or not storing/dumping tick data properly in file or DB. You can try out this example to check the same.