BITMEX Websocket connection drops / disconnects despite keep alive burning through connection pool

465 views Asked by At

Every once in a while Bitmex disconnects our websocket connection which forces us to reconnect. However, they provide a connection pool of 40 connections per hour. In times of low volatility it seems not to be a problem AT ALL, however as soon as trading activity goes up, we are running through these 40 connections in no time leaving our connection dead eventually.

We do have a keep-alive but it does not solve the problem at all.

We haven’t seen any specifics on the API documentation regarding how to deal with this problem, or the specific reasons we get so many close opcodes whenever the volatility raises

Does anyone know if we are doing something wrong?

EDIT: heartbeat is also in place

1

There are 1 answers

1
Sean Thorburn On

I suggest implementing heartbeats as per https://www.bitmex.com/app/wsAPI#Heartbeats

In general, WebSocket connections can drop if the connection remains idle for too long without transmitting any data.