As the title says, how many maximum parallel websocket connections can we have? is it 3 or 5, according to docs it should be 5 for a plus user, if I am not wrong, but at many other threads I’ve seen the max is apparently 3.
And I think it’s 3 as I am failing to create 4th websocket connection in my server…. the creation of 4th one fails.
May I get clarity on this?
Thanks.
I just reduced it to 3… and it’s still failing. I think the issue might be that I am doing this websocket creation from newly plus account, I subscribed to trial version recently, so it might be that it hasn’t synced yet, or the trial version only supports 2 connections like regular user?
I do have a plus account which isn’t trial version, so I’ll check that out… meanwhile may I know how long the limits might take to sync for this trial plus account? If they ever will.
tried this with a “real” plus account, and still it seems like 3 sockets are the limit? the 4th one is getting created… but after a while… getting disconnected “connection reset by peer”
So, on the plus account, with 3 sockets it’s working now… they’re getting subscribed.
But I am receiving actual data in only the last subscribed connected websocket.
few logs for clarity:
options-go-backend | 2025/11/28 14:08:53 📊 WebSocket Pool Status:
options-go-backend | 2025/11/28 14:08:53 - Active connections: 3/5
options-go-backend | 2025/11/28 14:08:53 - Total instruments: 7555
options-go-backend | 2025/11/28 14:08:53 - WebSocket 1: 3000/3000 instruments (100.0% capacity)
options-go-backend | 2025/11/28 14:08:53 - WebSocket 2: 3000/3000 instruments (100.0% capacity)
options-go-backend | 2025/11/28 14:08:53 - WebSocket 3: 1555/3000 instruments (51.8% capacity)
only getting the initial feed, and further feed data… from websocket 3.
options-go-backend | 2025/11/28 14:08:53 [WS-3] 📥 Received initial feed from Upstox (1555 feeds)
options-go-backend | 2025/11/28 14:09:12 ✅ Strategy Manager initialized
options-go-backend | 2025/11/28 14:09:12 ✅ All managers initialized successfully
options-go-backend | 2025/11/28 14:09:12 ⏰ Next re-initialization scheduled at 2025-11-29 09:15:00 (in 19h5m47.182786325s)
options-go-backend | HTTP server starting on port 9091…
options-go-backend | 2025/11/28 14:09:22 [WS-3] 📊 Processed 4000 market data updates (feeds in this message: 31)
options-go-backend | 2025/11/28 14:09:32 WebSocket client connected. Total clients: 1
options-go-backend | 2025/11/28 14:09:32 📤 Sending initial snapshot to new client (211 symbols)
options-go-backend | 2025/11/28 14:09:32 ✅ Initial snapshot encoded (3220264 bytes)
options-go-backend | 2025/11/28 14:09:32 ✅ Initial snapshot sent to client
options-go-backend | 2025/11/28 14:09:53 📸 Taking snapshot at 14:09:53
options-go-backend | 2025/11/28 14:10:14 WebSocket read error: websocket: close 1005 (no status)
options-go-backend | 2025/11/28 14:10:14 WebSocket client disconnected. Total clients: 0
options-go-backend | 2025/11/28 14:10:16 WebSocket client connected. Total clients: 1
options-go-backend | 2025/11/28 14:10:18 📤 Sending initial snapshot to new client (211 symbols)
options-go-backend | 2025/11/28 14:10:18 ✅ Initial snapshot encoded (3220264 bytes)
options-go-backend | 2025/11/28 14:10:18 ✅ Initial snapshot sent to client
options-go-backend | 2025/11/28 14:10:20 WebSocket client disconnected. Total clients: 0
options-go-backend | 2025/11/28 14:10:20 WebSocket client connected. Total clients: 1
options-go-backend | 2025/11/28 14:10:21 📤 Sending initial snapshot to new client (211 symbols)
options-go-backend | 2025/11/28 14:10:21 ✅ Initial snapshot encoded (3220264 bytes)
options-go-backend | 2025/11/28 14:10:21 ✅ Initial snapshot sent to client
options-go-backend | 2025/11/28 14:10:22 [WS-3] 📊 Processed 16000 market data updates (feeds in this message: 33)
options-go-backend | 2025/11/28 14:10:27 📊 Order flow snapshots collected: 12
options-go-backend | 2025/11/28 14:10:53 📸 Taking snapshot at 14:10:53
options-go-backend | 2025/11/28 14:11:12 WebSocket read error: websocket: close 1005 (no status)
options-go-backend | 2025/11/28 14:11:12 WebSocket client disconnected. Total clients: 0
options-go-backend | 2025/11/28 14:11:13 WebSocket client connected. Total clients: 1
options-go-backend | 2025/11/28 14:11:15 📤 Sending initial snapshot to new client (211 symbols)
options-go-backend | 2025/11/28 14:11:15 ✅ Initial snapshot encoded (3220264 bytes)
options-go-backend | 2025/11/28 14:11:15 ✅ Initial snapshot sent to client
options-go-backend | 2025/11/28 14:11:41 📊 Order flow snapshots collected: 24
options-go-backend | 2025/11/28 14:11:53 📸 Taking snapshot at 14:11:53
options-go-backend | 2025/11/28 14:12:53 📸 Taking snapshot at 14:12:53
NVM, after checking the docs again and again… finally found the issue. The thing is I recently switched from option_greeks mode to full mode. But still put 3000 instruments as the limit as that was what I remembered from when I was using option_greeks mode. But 2000 instrument is the limit for full mode.
That was the issue for the data only receiving in last connected websocket.
Though I am still unsure about the maximum websocket connections, as currently 3 is working, need to check more.
Update on this… getting inconsistent behaviour on how many websockets i can create… sometimes 3 works… sometimes 2…. sometimes only 1.
This is happening to both plus, and plus trial account.
Can I get clarity on this please as I need to plan my backend architecture based on what’s the case.
Ketan
December 1, 2025, 12:56pm
7
Hi @SHAIK_43162122
Both Plus and Trial users have access to 5 WebSocket connections .
In some cases, if the client does not disconnect properly, the connection may remain active on the server. This can lead to inconsistent behaviour when you try to establish new connections.
Please review your disconnect and error-handling logic to ensure that connections are closed cleanly.
Additionally, please share your six-digit user ID so we can investigate this further on our end.
Thanks!
shouldn’t the connection be closed from server side if no request/ping received from clients?
Hi Ketan,
My user id: 8GAGYJ
WS-0 keeps disconnecting every 70-90 seconds (code 1006). WS-1 and WS-2 are fine.
Setup:
Plus account
Fresh connection today (no previous WS connections)
WS-0: 1,913 instruments → disconnects constantly
WS-1: 1,900 instruments → stable
WS-2: 482 instruments → stable
Pattern:
12:17:13 - WS-0 disconnected (code 1006)
12:17:16 - Reconnected
12:18:28 - Disconnected again (73 sec)
Keeps repeating. I’m handling disconnect/ping properly. Server is closing it.
Is 1,913 too high? What’s the actual safe limit per connection?
some logs:
```
[2026-01-01T06:45:39.385Z] [SUBSCRIBE] [WS-2] Subscribing to 30 instruments (total will be: 482)
[2026-01-01T06:45:40.818Z] [DATA] [WS-2] Received initial feed from Upstox (14 feeds)
[2026-01-01T06:45:40.878Z] [DATA] [WS-2] Received initial feed from Upstox (30 feeds)
Frontend client connected (1 total)
[2026-01-01T06:47:13.638Z] [DISCONNECT] [WS-0] WebSocket disconnected (code: 1006, reason: Connection ended)
[2026-01-01T06:47:13.640Z] [RECONNECT] [WS-0] WebSocket disconnected. Reconnecting attempt 1/3 in 2 seconds (had 1913 instruments)
[2026-01-01T06:47:15.776Z] [CONNECT] [WS-0] Connecting to Upstox WebSocket…
[2026-01-01T06:47:15.977Z] [CONNECT] [WS-0] WebSocket connected successfully
[2026-01-01T06:47:15.978Z] [SUBSCRIBE] [WS-0] Subscribing to 1913 instruments (total will be: 1913)
[2026-01-01T06:47:15.978Z] [RECONNECT] [WS-0] WebSocket reconnected and resubscribed 1913 instruments successfully
[2026-01-01T06:47:16.976Z] [DATA] [WS-0] Received initial feed from Upstox (1913 feeds)
[2026-01-01T06:48:05.566Z] [DATA] [WS-1] Processed 1000 market data updates (feeds in this message: 42)
[2026-01-01T06:48:17.892Z] [DATA] [WS-2] Processed 1000 market data updates (feeds in this message: 3)
[2026-01-01T06:48:28.685Z] [DISCONNECT] [WS-0] WebSocket disconnected (code: 1006, reason: Connection ended)
[2026-01-01T06:48:28.685Z] [RECONNECT] [WS-0] WebSocket disconnected. Reconnecting attempt 1/3 in 2 seconds (had 1913 instruments)
[2026-01-01T06:48:30.844Z] [CONNECT] [WS-0] Connecting to Upstox WebSocket…
[2026-01-01T06:48:31.348Z] [CONNECT] [WS-0] WebSocket connected successfully
[2026-01-01T06:48:31.349Z] [SUBSCRIBE] [WS-0] Subscribing to 1913 instruments (total will be: 1913)
[2026-01-01T06:48:31.349Z] [RECONNECT] [WS-0] WebSocket reconnected and resubscribed 1913 instruments successfully
[2026-01-01T06:48:32.130Z] [DATA] [WS-0] Received initial feed from Upstox (1913 feeds)
[2026-01-01T06:49:59.315Z] [DISCONNECT] [WS-0] WebSocket disconnected (code: 1006, reason: Connection ended)
[2026-01-01T06:49:59.315Z] [RECONNECT] [WS-0] WebSocket disconnected. Reconnecting attempt 1/3 in 2 seconds (had 1913 instruments)
[2026-01-01T06:50:02.845Z] [CONNECT] [WS-0] Connecting to Upstox WebSocket…
[2026-01-01T06:50:04.359Z] [CONNECT] [WS-0] WebSocket connected successfully
[2026-01-01T06:50:04.360Z] [SUBSCRIBE] [WS-0] Subscribing to 1913 instruments (total will be: 1913)
[2026-01-01T06:50:04.360Z] [RECONNECT] [WS-0] WebSocket reconnected and resubscribed 1913 instruments successfully
[2026-01-01T06:50:05.035Z] [DATA] [WS-0] Received initial feed from Upstox (1913 feeds)
[2026-01-01T06:50:34.807Z] [DATA] [WS-1] Processed 2000 market data updates (feeds in this message: 42)
[2026-01-01T06:50:57.655Z] [DATA] [WS-2] Processed 2000 market data updates (feeds in this message: 8)
[2026-01-01T06:51:30.931Z] [DISCONNECT] [WS-0] WebSocket disconnected (code: 1006, reason: Connection ended)
[2026-01-01T06:51:30.931Z] [RECONNECT] [WS-0] WebSocket disconnected. Reconnecting attempt 1/3 in 2 seconds (had 1913 instruments)
[2026-01-01T06:51:34.313Z] [CONNECT] [WS-0] Connecting to Upstox WebSocket…
[2026-01-01T06:51:35.931Z] [CONNECT] [WS-0] WebSocket connected successfully
[2026-01-01T06:51:35.932Z] [SUBSCRIBE] [WS-0] Subscribing to 1913 instruments (total will be: 1913)
[2026-01-01T06:51:35.932Z] [RECONNECT] [WS-0] WebSocket reconnected and resubscribed 1913 instruments successfully
[2026-01-01T06:51:36.702Z] [DATA] [WS-0] Received initial feed from Upstox (1913 feeds)
[2026-01-01T06:51:57.708Z] [DATA] [WS-0] Processed 1000 market data updates (feeds in this message: 98)
[2026-01-01T06:52:51.456Z] [DISCONNECT] [WS-0] WebSocket disconnected (code: 1006, reason: Connection ended)
[2026-01-01T06:52:51.456Z] [RECONNECT] [WS-0] WebSocket disconnected. Reconnecting attempt 1/3 in 2 seconds (had 1913 instruments)
[2026-01-01T06:52:54.914Z] [CONNECT] [WS-0] Connecting to Upstox WebSocket…
[2026-01-01T06:52:55.969Z] [CONNECT] [WS-0] WebSocket connected successfully
[2026-01-01T06:52:55.970Z] [SUBSCRIBE] [WS-0] Subscribing to 1913 instruments (total will be: 1913)
[2026-01-01T06:52:55.970Z] [RECONNECT] [WS-0] WebSocket reconnected and resubscribed 1913 instruments successfully
[2026-01-01T06:52:56.681Z] [DATA] [WS-0] Received initial feed from Upstox (1913 feeds)
[2026-01-01T06:53:05.101Z] [DATA] [WS-1] Processed 3000 market data updates (feeds in this message: 52)
[2026-01-01T06:53:43.012Z] [DATA] [WS-2] Processed 3000 market data updates (feeds in this message: 2)
[2026-01-01T06:54:22.571Z] [DISCONNECT] [WS-0] WebSocket disconnected (code: 1006, reason: Connection ended)
[2026-01-01T06:54:22.571Z] [RECONNECT] [WS-0] WebSocket disconnected. Reconnecting attempt 1/3 in 2 seconds (had 1913 instruments)
[2026-01-01T06:54:26.557Z] [CONNECT] [WS-0] Connecting to Upstox WebSocket…
[2026-01-01T06:54:27.466Z] [CONNECT] [WS-0] WebSocket connected successfully
[2026-01-01T06:54:27.467Z] [SUBSCRIBE] [WS-0] Subscribing to 1913 instruments (total will be: 1913)
[2026-01-01T06:54:27.467Z] [RECONNECT] [WS-0] WebSocket reconnected and resubscribed 1913 instruments successfully
[2026-01-01T06:54:28.555Z] [DATA] [WS-0] Received initial feed from Upstox (1913 feeds)
[2026-01-01T06:55:34.094Z] [DATA] [WS-1] Processed 4000 market data updates (feeds in this message: 20)
[2026-01-01T06:55:52.487Z] [DISCONNECT] [WS-0] WebSocket disconnected (code: 1006, reason: Connection ended)
[2026-01-01T06:55:52.487Z] [RECONNECT] [WS-0] WebSocket disconnected. Reconnecting attempt 1/3 in 2 seconds (had 1913 instruments)
[2026-01-01T06:55:55.053Z] [CONNECT] [WS-0] Connecting to Upstox WebSocket…
[2026-01-01T06:55:55.465Z] [CONNECT] [WS-0] WebSocket connected successfully
[2026-01-01T06:55:55.465Z] [SUBSCRIBE] [WS-0] Subscribing to 1913 instruments (total will be: 1913)
[2026-01-01T06:55:55.465Z] [RECONNECT] [WS-0] WebSocket reconnected and resubscribed 1913 instruments successfully
[2026-01-01T06:55:55.836Z] [DATA] [WS-0] Received initial feed from Upstox (1913 feeds)
```
Hi Team, any response on this.