V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
Nazz
V2EX  ›  Go 编程语言

为了压测 websocket server 性能, 我写了一个命令行工具和生成图表脚本

  •  
  •   Nazz · 247 天前 · 1224 次点击
    这是一个创建于 247 天前的主题,其中的信息可能已经有所发展或是发生改变。

    仓库地址

    语言环境

    • go
    • nodejs

    安装依赖

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

    开始测试

    运行 5 轮测试, 最后取中位数

    make build
    pm2 start ./bin/*
    cd frontend
    npm install
    pm2 start index.js --watch
    sh bench.sh
    

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

    result

    2 条回复    2023-08-24 12:27:03 +08:00
    Nazz
        1
    Nazz  
    OP
       247 天前
    补充说明下, gorilla/websocket 和 nhooyr/websocket 未使用 stream api
    mrochcnnnnn
        2
    mrochcnnnnn  
       247 天前
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2954 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 13:16 · PVG 21:16 · LAX 06:16 · JFK 09:16
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.