Need an approach (if feasible) for scenario: With one open WebSocket connection I need to iterate over the multiple entries in csv file. This iterations should run in parallel and be using existing opened WebSocket connection

Issue #240 closed
shweta chikhalikar created an issue

.csv file is an input file which contains data in format as - PID,CID,TID,UID(UserID)

ex: 2 entries from file are as below -

4935,4932,1,102
4936,4933,1,102

JMeter Test Plan flow - <JMeterTestPlan_02.PNG>

  1. WebSocket Open Connection
  2. GetConnectionID ( WebSocket Req-Resp Sampler) - Here we get the Connection_ID in the response for the User logged in (ex: 102 - UserID)
  3. Update ConnectionID for User ( WebSocket Req-Resp Sampler) - Here we update the above received Connection_ID in the request and we get response as User updated
  4. Process TVG ( WebSocket Req-Resp Sampler) request is fired and response received is “Segmentation started”
  5. WebSocket Single Read Sampler ( used twice ) to capture the remaining text frames as a response.
  6. These 2 resposnses received from 2 - WebSocket Single Read Samplers are combined in the Dummy Sampler to receive the response fully and then do Response Assertion to verify.

Settings done in JMeter -

  1. From steps 2-6, we have selected - Use existing connection option
  2. Thread count is 1, ramp-up time is 1 and loop count is 1
  3. Loop Controller Count = 2 ( for 2 entries in .csv file )

Objective - Need to process the records in .csv file parallelly using only one WebSocket connection opened.

Problem Statement - Currently, using Loop controller it is happening sequentially. Here, JMeter will run 1 thread and after completion of the previous thread, the next thread will start and so on up to 2 times.
If the load is increased say from 2 to 500, it will eventually have a very less impact on the server, because the execution is consecutively and not parallelly/concurrently. Here, only one 1 thread remains alive.

The requests present inside the Loop Controller should be executed parallelly and not sequentially. Need to discard the Loop Controller. So, how to achieve this parallelly using only one opened WebSocket connection. Can this be achieved and if yes, please let me know how it can be done ?

Comments (4)

  1. Peter Doornbosch repo owner

    From https://bitbucket.org/pjtr/jmeter-websocket-samplers/src/master/FAQ.md:

    I want to share a WebSocket connection between different Thread Groups

    You can't. This is by design, because one of the main esign principles of this plugin is to keep it easy to use and sharing WebSocket connections between JMeter threads would lead to trouble that is not easy to solve; to give a simple example, consider what the plugin would be supposed to do with a received message, to which thread it should be returned.

    The solution for cases where you think you might need this feature, is to create a serial test plan. Common cases as unpredictable ping frames can be solved by adding a "Frame Filter" that discards the ping before your Sampler can read it.


    Does this answer your question?

  2. Log in to comment