0

I am using random variable to generate port numbers and used the variable in the port field of HTTP Sampler. I have tried to replace this with a counter variable also. Range is around 300 ports. I need to send traffic to 300 ports but when i send load I see that Jmeter is creating 10x connections for each port and continuosly connecting and disconnecting.

 Connection received for HTTPSERVER E-16002-EP, Remote IP Address 10.13.194.52, Remote Port 46486
Disconnect received for HTTPSERVER E-16002-EP, Remote IP Address 10.13.194.52, Remote Port 59720, Bytes sent 3694, Bytes rcvd 5384, Msgs sent 2, Msgs rcvd 2, Up 0d 0h 1m 11.078s.

How do I make Jmeter reuse thread connections and not reconnect after the transaction is complete. Keep-alive is on and below settings are also set

httpclient4.idletimeout=70000
httpclient4.validate_after_inactivity=66000
httpclient4.time_to_live=70000
Zack
  • 117
  • 2
  • 12

2 Answers2

2

You can use the property httpclient.reset_state_on_thread_group_iteration to reuse the http connection.

Set following in your {JMTER_HOME}/bin/user.properties and restart the JMeter.

httpclient.reset_state_on_thread_group_iteration=false

By default the value is set to httpclient.reset_state_on_thread_group_iteration=true in the jmeter.properties

Janesh Kodikara
  • 1,670
  • 1
  • 12
  • 23
  • 1
    Janesh, interestingly I have enabled this and still facing the disconnects. Below are the settings already set for SSL. https.sessioncontext.shared=true https.use.cached.ssl.context=true httpclient.reset_state_on_thread_group_iteration=false – Zack Aug 14 '21 at 03:23
  • Zack, Let me check as time permits and check the issue. The Jmeter documentation should have sufficient instructions. You may refer to it meantime – Janesh Kodikara Apr 25 '23 at 05:07
1

If you want the full control of what's going on under the hood:

Dmitri T
  • 159,985
  • 5
  • 83
  • 133