Search code examples
websocketjmeterstreaming

Load test websocket with continous streaming using JMeter


The WebSocket stream in JMeter is executed only for a frame, I am not able to load test continuous stream using the jars available @ https://bitbucket.org/pjtr/jmeter-websocket-samplers

Jmeter WebSocket jmx When I try triggering the WebSocket request via terminal, it streams output/logs. But in case of JMeter the Websocket runs only for a frame.

WSS request with Port 443:

Thanks for answering the query. Please can you clear some of my doubts: I am trying to load test a scenario where the client is continuously listening to WebSocket.

1 Using a jar file I am able to continuously stream the data when I hit the java jar in the terminal. I can see the data flowing

2. Now I try to replicate the scenario in JMeter, the sampler acts like a request/response, where the connection is lost after the response.

3. Now if I set a loop in JMeter, it does not satisfy the purpose of streaming. It will act as multiple requests sent to the same channel.

Also in the attached image link, the checkbox for Streaming Connection is checked, but it acts like request/response.

Is looping the only option for WebSocket streaming?

Thread Name: Thread Group 1-1 Sample Start: 2017-04-27 17:21:40 IST Load time: 1383 Connect Time: 0 Latency: 0 Size in bytes: 1065 Sent bytes:0 Headers size in bytes: 0 Body size in bytes: 1065 Sample Count: 1 Error Count: 0 Data type ("text"|"bin"|""): Response code: 200 Response message:

[Execution Flow] - Opening new connection - Using response message pattern "" - Using disconnect pattern "" - Waiting for the server connection for 60000 MILLISECONDS - WebSocket conection has been opened - Connection established - Waiting for messages for 60000 MILLISECONDS - Received frame #1 (15 bytes); matched response pattern - Received message #2 (15 bytes); matched response pattern - Leaving streaming connection open

[Variables] - Message count: 2

[Problems]

Response headers:

SampleResult fields: ContentType: DataEncoding: UTF-8


Solution

  • (I cannot comment, that would have been more appropriate for the first part)

    According to the text in your post, you are using https://bitbucket.org/pjtr/jmeter-websocket-samplers, but the logging you posted is not from that plugin but from Maciej Zaleski's plugin....

    I'm not 100% sure what you mean with "load test continuous stream", but if you mean that the server is just pushing frames to the client, that can be tested with the former plugin. Just setup a loop with a "Single read sampler"...