小编Jer*_*oen的帖子

NodeJS socket.io 无法处理性能测试中的到达率

在对我的 node.js socket.io 应用程序进行性能测试时,它似乎无法处理所需数量的并发 websocket 请求。

我正在使用以下规范在 Docker 环境中测试应用程序:

CPU:2 内存:4 GB

该应用程序被精简到只接受带有 socket.io + express.js 的 websocket 连接的最低限度。

我在artillery.io的帮助下进行了测试,测试场景是:

config:
  target: "http://127.0.0.1:5000"
  phases:
    - duration: 100
      arrivalRate: 20
scenarios:
    - engine: "socketio"
      flow:
      - emit:
          channel: "echo"
          data: "hello"        
      - think: 50
Run Code Online (Sandbox Code Playgroud)

报告:

Summary report @ 16:54:31(+0200) 2018-07-30
  Scenarios launched:  2000
  Scenarios completed: 101
  Requests completed:  560
  RPS sent: 6.4
  Request latency:
    min: 0.1
    max: 3
    median: 0.2
    p95: 0.5
    p99: 1.4
    Scenario counts:
    0: 2000 (100%) …
Run Code Online (Sandbox Code Playgroud)

node.js socket.io docker artillery

5
推荐指数
0
解决办法
1605
查看次数

标签 统计

artillery ×1

docker ×1

node.js ×1

socket.io ×1