Skip to content

JMeter Socket Closed Connection Reset

Fix JMeter connection reset and socket closed errors under load: server limits, idle timeouts, keep-alive, injector ports, and TLS drops. Symptom and fixes.

Difficulty
intermediate
Guide type
troubleshooting
Estimated read time
6 min read
Last verified version
Verified JMeter 5.6

Socket closed / connection reset in JMeter

Section titled “Socket closed / connection reset in JMeter”

Samples fail mid-run or under higher concurrency with messages such as:

  • Connection reset / Connection reset by peer
  • Socket closed / SocketException
  • Broken pipe
  • Often shown as Non HTTP response code

Unlike pure connection refused, some samples may succeed first; failures increase with load or longer tests.

CauseDetail
Server or load balancer limitsMax connections, rate limits, or worker exhaustion
Idle timeoutsLB/proxy closes keep-alive connections JMeter tries to reuse
Injector ephemeral port / file descriptor exhaustionMany short connections from one host
TLS session / middlebox interferenceIntermittent handshake or reset under load
SUT crash or restartBursts of resets when the app dies
Aggressive timeoutsClient gives up; appears as socket errors depending on stack
Network path instabilityVPN, NAT, or multi-hop firewalls
  1. Capture error rate vs active threads on the dashboard and SUT metrics (connections, 5xx, restarts).
  2. Reproduce with moderate threads; note whether failures are immediate or after idle.
  3. Align keep-alive behaviour with the environment (HTTP client settings / connection reuse). If a proxy closes idle sockets quickly, reduce reuse or match idle timeouts.
  4. Check SUT and LB max connections and idle timeout documentation for your stack.
  5. On the injector: watch open files, TIME_WAIT, and CPU; split load across engines if the client is saturated (distributed testing, Thread Calculator).
  6. Distinguish from ConnectException (never connected) vs reset (peer closed an established or half-open connection).
  7. Review TLS separately if resets cluster around HTTPS only (SSLHandshakeException).
  8. Ensure you are not melting the SUT with zero think time and huge threads (best practices).
ResourceUse when
Throughput stuckResets plus flat RPS
OutOfMemoryError heapInjector death causing drops
Coordinated OmissionThroughput below target while latency looks fine
Grafana / Backend ListenerLive error charts

Rarely. It usually means something on the path or server closed the TCP connection. Validate with server and load-balancer metrics.

Connection pools and OS limits appear only when many sockets are open. One-thread tests often hide them.

Sometimes as a diagnostic. Prefer fixing idle timeouts and server capacity; disabling keep-alive increases handshakes and can worsen injector load.

On this page