gpt4 book ai didi

benchmarking - 如何加载测试服务器发送事件?

转载 作者:行者123 更新时间:2023-12-04 00:08:53 27 4
gpt4 key购买 nike

我有一个发送服务器发送事件的小应用程序。我想对我的应用程序进行负载测试,以便我可以对从推送消息到收到消息的延迟进行基准测试,这样我就可以知道性能何时/何处出现故障。有哪些工具可以做到这一点?

最佳答案

由于 Server-Sent Events 它只是 HTTP,您可以使用 siege 实用程序。示例如下:

siege -b -t 1m -c45 http://127.0.0.1:9292/streaming

地点:

  • -b 基准模式,即不要在连接之间等待
  • -t 1m 基准测试 1 分钟
  • -c45并发连接数
  • http://127.0.0.1:9292 我的开发服务器主机和自定义端口
  • /streaming 响应 Content-Type: text/event-stream
  • 的 HTTP 端点

输出:

Lifting the server siege...      done.

Transactions: 79 hits
Availability: 100.00 %
Elapsed time: 59.87 secs
Data transferred: 0.01 MB
Response time: 23.43 secs
Transaction rate: 1.32 trans/sec
Throughput: 0.00 MB/sec
Concurrency: 30.91
Successful transactions: 79
Failed transactions: 0
Longest transaction: 30.12
Shortest transaction: 10.04

关于benchmarking - 如何加载测试服务器发送事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18089085/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com