https://github.com/dwango-js/io-bench
A benchmark tool for socket.io, engine.io and websocket server
https://github.com/dwango-js/io-bench
Last synced: 3 months ago
JSON representation
A benchmark tool for socket.io, engine.io and websocket server
- Host: GitHub
- URL: https://github.com/dwango-js/io-bench
- Owner: dwango-js
- Created: 2015-06-02T14:37:26.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-06-03T14:42:21.000Z (about 11 years ago)
- Last Synced: 2025-03-23T11:12:18.730Z (over 1 year ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
io-bench
========
[](https://travis-ci.org/dwango-js/io-bench)
A benchmark tool fo socket.io, engine.io and websocket server.
```js
// socket.io server to test
var io = require('socket.io');
var server = io(8080);
server.on('connection', function(socket) {
socket.on('message', function(data) {
// echo data so that we can benchmark response time.
socket.send(data);
});
});
```
Running benchmark.
```sh
$ io-bench http://localhost:8080
```
## Installation
```sh
npm install -g io-bench
```
## Usage
```
Usage: io-bench [options]
Options:
-h, --help output usage information
-n, --connections number of connections to perform per worker
-c, --concurrency number of new connections to establish at a time per worker
-m, --messages messages to be sent per connection
-R, --message-rate number of messages to be sent per second
-b, --buffer max size of a message
-w, --workers number of workers, default to numbers of CPU
-p, --polling-rate rate of polling (only for socket.io and engine.io)
-s, --sync whether to wait all connections are established before sending messages
-t, --transport transport type, one of socket.io, engine.io or websocket. default to socket.io
```
### Examples
Set number of connections and messages.
```sh
$ io-bench -n 100 -c 10 -m 1000 -R 30 http://localhost:8080
```
Change transport to use.
```sh
$ io-bench -t websocket http://localhost:8080
```
## License
MIT