在Jmeter中对WebSocket进行压力测试 [英] Stress testing WebSockets in Jmeter

查看:221
本文介绍了在Jmeter中对WebSocket进行压力测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Jmeter的插件对我的WebSocket服务器进行压力测试( jmeter-websocket ).事实是,该插件没有提供有关如何使用它的文档,因此我不确定是否支持我的期望.

I'm trying to stress test my WebSocket server using Jmeter's plugin (jmeter-websocket). The thing is that the plugin comes with no documentation how to work with it and thus I'm not sure if my expectations of it is supported or not.

我设法使用提到的插件运行了一个示例测试,它已成功连接到服务器.它也设法与服务器通信,但是一旦完成接收到第一个响应,它就断开了连接.我希望以某种方式配置此插件,以便它将与WebSocket服务器的连接保持几分钟,在断开连接之前发送和接收一些消息.

I managed to run a sample test using the mentioned plugin and it was successfully connected to server. It also managed to communicate with server but once it was done receiving the first response it disconnected. I was hoping to configure this plugin in a way so it will maintain a persistent connection with WebSocket server for several minutes, sending and receiving a couple of messages before it is disconnected.

通过压力测试,我想了解并发连接的数量如何影响我的应用程序的行为.这个插件适合我的需求吗?如果是这样,我应该如何使用它?

By stress testing I would like to see how the number of concurrent connections affect my application's behavior. Is this plugin suitable for my needs? If it is then how should I work with it?

推荐答案

我遇到了完全相同的问题.您提到的插件仅适用于类似HTTP的请求/响应,但我无法将其用于长"连接.

I had exactly the same problem. the plugin you have mentioned worked only for a HTTP-like request/response but I couldn't use it for a "long" connection.

看看这个 http://github.com/maciejzaleski/JMeter

功能:

  • 支持WebSocket协议的HTTS/HTTPS(ws/wss)版本
  • 忽略SSL证书错误的选项
  • 流式传输允许单个连接在测试期间保持打开状态
  • 响应必须匹配预定义的正则表达式
  • 响应超时
  • 响应消息积压(从多条服务器消息构建Sampler响应)
  • 如果服务器发送匹配预定义正则表达式的消息,则连接可能会关闭

这篇关于在Jmeter中对WebSocket进行压力测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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