increasing delays on @bookTicker streams

Hi , i’m trying to construct a local futures orderbook(depth1, only need best ask,bid) through btcusdt@bookTicker stream.

To monitor the time gap between the real bookdata and the received time, i’m tracking the timediff.
timediff = +new Date() -;

At first, average time differences are below 5~10ms but within few minutes it quickly increases to 8000ms~500000ms that i absolutely can’t use those info at trading . sometimes it goes back to normal, but usually it persists like that.
i’m answering to the ping/pong stream and using AWS Tokyo region EC2 t2 with ubuntu+nodejs.

Is there any additional action that i should do to keep my websocket connection without the insane delays?
With same code, upbit and bithumb exchanges’ ws connections are maintained properly.

i’m attaching the partial code that i used to setup WS.

_setupWebSocket(eventHandler, path) {
		if (this._sockets[path]) {
			return this._sockets[path];
		path = this._baseUrl + path;
		const ws = new WebSocket(path);
		this._sockets[path] = ws;
		ws.on("ping", (data) => {
			ws.isAlive = true;
			ws.lastAlive = new Date();
		ws.on("message", (message) => {
			let event;
			try {
				event = JSON.parse(message);
			} catch (e) {
				event = message;
			if (this._beautify) {
				if ( { = this._beautifyResponse(;
				} else {
					event = this._beautifyResponse(event);

		ws.on("error", (e) => {;
			// node.js EventEmitters will throw and then exit if no error listener is registered

		return ws;

actual path stream i used:


If it persists like this, please check your network stability and the capacity of your server; It’s either the performance of the network or not enough buffer of your server;
I checked from my end using your exact market streams and everything is stable

network stability should be alright cause other exchanges are kept under 30ms with the same condition. can i ask you to show me your websocket construction part js code and aws instance type?? does it kept normal for more than an hour?

p.s. i’ve upgraded my instance but the problem persists…

too much streams in one connection, try to remove some of them and see if things getting better.

few ms delay may be b/c of that but 500000ms can’t be explained by that i think…

we don’t see similar delay can up to 500s.

would switching to All bookticker stream more helpful than subscribing many individual tickers?