I'm running a load test using a JMeter, and my load test is consuming a lot of TCP connections. The machine that creates the load is not experiencing the Ephemeral port exhaustion, but a router trough the load was created, run out of NAT tablespace so I came to think if JMeter uses the connections like real browser. So far it seems that Jmeter exhausts connections more than real browser. My questions is that how could I create load that uses TCP connections like real browser would across the whole network ( If that is possible ).

I'm using JMeter 5.0. The calls in script use HttpClient4. The "Use KeepAlive" is checked. When I run the test and check the TCP connection status in my local computer, the active connections makes sense, but there is enormous amount of tcp connections in "TIME_WAIT" state. ( eg. 120 threads running, 3200 load test related connections total, mostly in TIME_WAIT ). Is there something I could do to make Jmeter to reuse the same connections?

When I do the same transactions with real browsers, the amount of connections does not rise. ( With Chrome the amount of TCP connections stay at 6 per user. Using Firefox the amount seems to rise slowly, but way slower than when using Jmeter. )

My browsers use HTTP 2, and Jmeter script goes with HTTP 1.1. Would this make the difference here?

1 Answer 1


I found out that the reason for faster-than-real-browser port recycling was the default Jmeter httpclient parameter. When I used

httpclient4.time_to_live=70000 httpclient4.validate_after_inactivity=66600

the problem seemed to go away - Jmeter uses the same port longer now. I also set


which on my load scenario is more accurate simulation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.