No description, website, or topics provided.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
browser-client.html
client.js
package.json
socket.io-app.js
websocket-node-app.js
websocket.io-app.js
ws-app.js
ws-client.js

README.md

Binary Data Transfer Benchmark for Socket.IO, websockt.io, WebSocket-Node, and ws

This benchmark reports client -> server -> client binary data transfer latency on websocket and calculates the throughput. The binary data is randomly generated, and the websocket protocol is version 13.

Dependencies Install

$ npm install

Quick Start on localhost

$ npm install

# WebSocket-Node benchmark
$ node websocket-node-app.js&
$ node client.js 1048576 5
$ killall node

# websocket.io benchmark
$ node websocket.io-app.js&
$ node client.js 1048576 5
$ killall node

# Socket.IO did not work under the author's environment
$ node socket.io-app.js&
$ node client.js 1048576 5
$ killall node

# ws benchmark
$ node ws-app.js&
$ node ws-client.js 1048576 5
$ killall node
# the best benchmark result under the author's environment
# over 2Gbps!!!

Arguments

xxx-app.js [https=false]

  • If the first argument is given, xxx-app.js starts listening to https (and wss). If this option is on, xxx-app.js requires server.cert and server.key files.

xxx-client.js dataSize, numberOfMeasurement, [https=false]

  • The first argument is dataSize (Bytes) in decimal to send.
  • The second argument decides the number of Measurements for averaging (denominator of average).
  • If the third argument is given, client.js uses https (and wss).

Tips

In order to quickly calculate the dataSize, `echo "2^20"|bc` tricks can be useful. For example, benchmarking 1MiB (= 2^20) data transferring performance, use

 $ node client.js `echo "2^20"|bc` 5

In order to run on a remote server, edit client.js and change the serverName.