Giter Site home page Giter Site logo

websocket-benchmark's Introduction

websocket-benchmark

WebSocket-benchmark is a WebSocket benchmark tool, similar to the HTTP benchmark tool Apache bench (ab). It is simple and easy to use.

Install

go install go-disf/websocket-benchmark

Document

use -h to read the document:

$./websocket-benchmark -h
./websocket-benchmark [options] -url [http://]hostname[:port]/path
Options are:
  -b    Send data use websocket binary mode
  -c int
        Number of multiple requests to make at a time (default 1)
  -h    Display usage information (this message)
  -k    Use HTTP KeepAlive feature (default true)
  -n int
        Number of requests to perform
  -url string
        File containing data to POST. 

Examples

$./websocket-benchmark -c 1000 -n 100000 -url ws://127.0.0.1:8080/ws
Benchmarking 127.0.0.1 (be patient)
Completed 100000 requests
Completed 200000 requests
Completed 300000 requests
Completed 400000 requests
Completed 500000 requests
Completed 600000 requests
Completed 700000 requests
Completed 800000 requests
Completed 900000 requests
Completed 1000000 requests

Server Scheme:          ws
Server Hostname:        127.0.0.1
Server Port:            8080

Document Path:          /ws

Concurrency Level:      1000
Time taken for tests:   31.0906628s
Complete requests:      1000000
Failed requests:        0
Total data sent:        71000000 bytes
Total data recv:        73000000 bytes
Requests per second:    32164.00 [#/sec] (mean)
Time per request:       30.57 [ms] (mean)
Transfer rate:          2347.9717 [Kbytes/sec] received
                        2283.6438 kb/s sent

Connection Times (ms)
                                        min  mean[+/-sd] median   max
Connect:         0               0       0       0       7
Sent:            0               0       0       0       32
Recv:            0               31      7       29      166
Total:           0               31      7       29      166

Percentage of the requests served within a certain time (ms)
  50%    29
  66%    30
  75%    32
  80%    33
  90%    37
  95%    41
  98%    47
  99%    53
 100%    166 (longest request)

License

MIT licensed. See the LICENSE file for details.

websocket-benchmark's People

Contributors

sdfwds4 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.