如何加载测试服务器已发送事件? [英] How to load test Server Sent Events?

查看:80
本文介绍了如何加载测试服务器已发送事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a small app that sends Server Sent Events. I would like to load test my app so I can benchmark the latency from the time a message is pushed to the time the message is received so I can know when/where the performance breaks down. What tools are available to be able to do this?

推荐答案

由于Server-Sent Events只是HTTP,因此可以使用siege实用程序.这是示例:

Since Server-Sent Events it is just HTTP you can use siege utility. Here is the example:

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端点
  • -b benchmark mode i.e. don't wait between connections
  • -t 1m benchmark for 1 minute
  • -c45 number of concurrent connections
  • http://127.0.0.1:9292 my dev server host and custom port
  • /streaming HTTP-endpoint which respond with Content-Type: text/event-stream

输出:

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

这篇关于如何加载测试服务器已发送事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆