From 71bd413980ff70cd6bfe75f96bd1ac123d3d6a84 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Tue, 7 Feb 2017 23:00:10 -0800 Subject: [PATCH] perf: disable perMessageDeflate From the ws docs: "ws supports the permessage-deflate extension extension which enables the client and server to negotiate a compression algorithm and its parameters, and then selectively apply it to the data payloads of each WebSocket message. The extension is enabled by default but adds a significant overhead in terms of performance and memory comsumption. We suggest to use WebSocket compression only if it is really needed. To disable the extension you can set the perMessageDeflate option to false" --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.js b/server.js index 1c1917d..6ba51a7 100644 --- a/server.js +++ b/server.js @@ -118,7 +118,7 @@ function Server (opts) { }) }) } - self.ws = new WebSocketServer({ server: self.http }) + self.ws = new WebSocketServer({ server: self.http, perMessageDeflate: false }) self.ws.address = function () { return self.http.address() }