Stress testing WebSockets in Jmeter

三世轮回 提交于 2019-12-30 03:05:06

问题


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.

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?


回答1:


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.

Have a look at this http://github.com/maciejzaleski/JMeter

Features:

  • Supports HTTS/HTTPS (ws/wss) version of the WebSocket protocol
  • Option to ignore SSL certificate errors
  • Streaming allows for a single connection to remain open for the duration of the test
  • Response has to match predefined regular expression
  • Response timeout
  • Response message backlog (build the Sampler response from multiple server messages)
  • Connection could be closed if server sends a message matching predefined regular expression



回答2:


As of November 2017, the best Websocket Sampler for Apache JMeter is this 3rd party plugin:

  • https://bitbucket.org/pjtr/jmeter-websocket-samplers

It can easily be installed through jmeter-plugins plugin manager.



来源:https://stackoverflow.com/questions/18557531/stress-testing-websockets-in-jmeter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!