Socket
Socket
Sign inDemoInstall

socketcluster

Package Overview
Dependencies
Maintainers
1
Versions
415
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

socketcluster - npm Package Compare versions

Comparing version 0.9.6 to 0.9.7

.npmignore

10

package.json
{
"name": "socketcluster",
"description": "SocketCluster - A Highly parallelized WebSocket server cluster to make the most of multi-core machines/instances.",
"version": "0.9.6",
"version": "0.9.7",
"homepage": "https://github.com/topcloud/socketcluster",

@@ -13,10 +13,6 @@ "contributors": [

"dependencies": {
"iocluster": ">=0.9.13",
"iocluster": ">=0.9.14",
"loadbalancer": ">=0.9.10",
"ndata": ">=0.9.33",
"socketcluster-server": ">=0.9.16"
"socketcluster-server": ">=0.9.17"
},
"bundleDependencies": [
"json"
],
"keywords": [

@@ -23,0 +19,0 @@ "websocket",

@@ -35,2 +35,4 @@ SocketCluster

**Scroll to the bottom of this README for results of benchmark tests.**
## How to use

@@ -128,3 +130,3 @@

// Emit a 'greet' event on the current socket with value 'hello world'
socket.emit('greet', 'hello world')
socket.emit('greet', 'hello world');

@@ -177,3 +179,3 @@ /*

httpServer.on('req', app);
}
};
```

@@ -279,3 +281,3 @@

// worker here is an instance of SocketWorker
}
};
```

@@ -285,2 +287,27 @@

A ClusterServer instance is returned from worker.getWSServer() - You use it to handle WebSocket connections.
A ClusterServer instance is returned from worker.getWSServer() - You use it to handle WebSocket connections.
## Benchmarks
### Method
For this CPU benchmark, we compared Socket.io with SocketCluster on an 8-core Amazon EC2 m3.2xlarge instance running Linux.
For this test, a new client (connection) was opened every 5 seconds - As soon as the connection was established,
each new client immediately started sending messages at a rate of 1000 messages per second to the server.
These messages were dispatched through a 'ping' event which had an object {param: 'pong'} as payload.
The server's logic in handling the message was pretty basic - It would simply count the number of such messages received and log the value every 10 seconds.
### Observations
* When run as a single process on a single CPU core, SocketCluster performs worse than Socket.io.
* As you add more CPU cores and more processes (proportional to the number of cores), SocketCluster quickly catches up. SocketCluster became worthwhile as soon as you added a second CPU core.
* Until a certain point, traffic was not distributed exactly evenly between the SocketCluster load balancers - Initially, one of the load balancer processes was handling more than 2 times
as much load as the next one.
* As the strain on that load balancer increased to around the 50% CPU mark, other load balancers started picking up the slack... This must have something to do with way the OS does
its round robin balancing.
* The test was only set to reach up to 100 concurrent connections (each sending 1000 messages per second) - Total of 100K messages per second. SocketCluster was still in decent shape.
### Screenshots
![alt tag](https://raw.github.com/topcloud/socketcluster/master/benchmarks/socketcluster_socket_io_test_1.png)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc