Use
stream-server-uws
See also: meteor/meteor#10120
By default, the Meteor Stream Server using the SockJS library for handling WebSocket messages of the Distributed Data Protocol (DDP).
The advantage of the SockJS library is that if the WebSocket protocol are not supported by a browser, then it allows you to use alternative transports.
The disadvantage it is eating CPU and RAM, and with a large number of DDP connections and messages, the memory starts to leak.
Can I use WebSockets only?
This solution based on the ClusterWS/cWS β C++ WebSocket implementation for Node.js.
Open your project:
cd your-project-root
If your project not a Git repository then initialize it:
git init
-
Replace
ddp-server
andsocket-stream-client
, installdisable-sockjs
,stream-server
andstream-server-uws
packages via Git:git submodule add https://github.com/mrauhu/ddp-server packages/ddp-server git submodule add https://github.com/mrauhu/disable-sockjs packages/disable-sockjs git submodule add https://github.com/mrauhu/socket-stream-client packages/socket-stream-client git submodule add https://github.com/mrauhu/stream-server packages/stream-server git submodule add https://github.com/mrauhu/stream-server-uws packages/stream-server-uws
-
Enable Stream Server with the
@clusterws/cws
:meteor add stream-server-uws
Run the Meteor:
meteor
- Dmitrii Goriunov, developer of ClusterWS;
- you.