Kaushal Sethia
Kaushal Sethia

Reputation: 1

Issues with WebSocket Chunk Delivery in Apache JMeter

Question: I am currently using Apache JMeter to test a system that involves multiple HTTP requests and WebSocket (WSS) connections with port 443. I have configured a Thread Group to handle these requests, and while most of the time the WebSocket successfully delivers all the chunks of data, I am encountering intermittent issues.

Specifically: In some instances, the WebSocket does not deliver all the expected chunks of data. Occasionally, the WebSocket connection fails altogether. Despite these issues, the data seems to be successfully saved to the database when I verify it. I am seeking advice on how to troubleshoot and resolve these WebSocket issues in JMeter. Here are a few points where I would appreciate guidance:

Debugging WebSocket Delivery: What strategies can I use to ensure that all chunks are delivered and processed correctly?

Handling WebSocket Failures: What are common reasons for WebSocket failures in JMeter, and how can they be mitigated?

Correlation with Database Save: How can I verify and correlate the successful saving of data to the database with the WebSocket communication in JMeter?

Any insights or recommendations on how to address these issues effectively would be greatly appreciated.

Thank you for your assistance.

To address these problems, I have tried adjusting the connection and response times in the WebSocket configuration:

Current Connection Timeout: 400,000 ms Current Response Timeout: 18,000,00 ms Even with these adjustments, I am still encountering the following problems:

Success but Incomplete Data: In some cases, the WebSocket shows a success status, but not all chunks are fetched.

Failure Cases: There are instances where the WebSocket connection shows as failed.

Websocket Sampler Image

Upvotes: 0

Views: 36

Answers (1)

Ivan G
Ivan G

Reputation: 2707

It might be the case the response is fragmented into several frames and you will either need to add an instance of WebSocket Sampler per frame or use While Controller utilising ${websocket.last_frame_final} function

If it is not the case you can enable JMeter debug logging for WebSocket plugin by adding the next line to log4j2.xml file (lives in "bin" folder of your JMeter installation)

<Logger name="eu.luminis" level="debug" />

If problems with WebSocket samplers occur only under the certain load it might indicate a bottleneck in the system under test

Upvotes: 0

Related Questions