websocket压测工具分享

分享一个个人开发的websocket压测工具: wsbench
提供IOPS, P50, P90, P99等指标
支持导出压测结果到JSON文件, 配合脚本生成图表

NAME:
   wsbench - testing websocket server iops and latency

USAGE:
   wsbench [global options] command [command options] [arguments...]

COMMANDS:
   echo
   broadcast
   version
   help, h    Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h  show help

导出图表教程

语言环境

  • go
  • nodejs

安装依赖

npm install pm2 -g
go install github.com/lxzan/wsbench@latest

环境变量

export PATH=$PATH:$GOPATH/bin

开始

git clone https://github.com/lxzan/go-websocket-testing.git
cd go-websocket-testing
make build
pm2 start ./bin/*
cd frontend
npm install
pm2 start index.js --watch
sh bench.sh

测试程序退出后, 访问 http://localhost:8080

Go

本作品采用《CC 协议》,转载必须注明作者和本文链接
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!