Next Practical Step
Add explicit connect and response timeouts to HTTP Request Defaults, then check server-side APM logs during the next test run.
Fix JMeter SocketTimeoutException: Read timed out and connect timed out errors. Understand root causes, server latency vs client timeouts, and configuration.
In the View Results Tree listener, jmeter.log, or JTL output, a sampler fails with:
Response code: Non HTTP response code: java.net.SocketTimeoutExceptionResponse message: Non HTTP response message: Read timed outOr during the initial TCP connection phase:
Response code: Non HTTP response code: java.net.SocketTimeoutExceptionResponse message: Non HTTP response message: connect timed outThe sample is marked as failed without a standard HTTP status code (such as 200, 500, or 504).
SocketTimeoutException: Read timed out means JMeter connected successfully to the server, sent the request, but the server failed to transmit response bytes within the configured Response Timeout. connect timed out means the initial TCP 3-way handshake did not finish within the Connect Timeout.
| Cause | Specific Error | Why it happens |
|---|---|---|
| Slow server processing | Read timed out | Database locks, CPU saturation, or heavy downstream microservice calls delay response generation beyond client timeout |
| Full GC pause on server | Read timed out | Stop-the-world garbage collection pauses the application worker threads, causing all in-flight sockets to stall |
| Connect timeout too aggressive | connect timed out | Network latency, TLS negotiation overhead, or SYN queue backlog exceeds a short Connect Timeout (e.g. 500ms) |
| Missing timeout configuration | Hangs indefinitely | When timeouts are blank (default 0), JMeter threads wait indefinitely for dead TCP connections until the OS socket timeout triggers |
| Load balancer / proxy silent drop | Read timed out | Intermediate firewall or load balancer drops the idle connection without sending a TCP RST or FIN packet |
connect timed out: The failure is on the network or firewall layer before the server processed anything. Check host reachability, firewall rules, and ingress controller SYN queues.Read timed out: The server received the request but took too long to answer. The bottleneck is inside the application or database layer.Never leave timeouts empty (0 means infinite in Java sockets). Add explicit thresholds in HTTP Request Defaults under the Timeouts (milliseconds) section:
Connect: 10000 (10 seconds)Response: 60000 (60 seconds)You can parameterize timeouts with properties for dynamic CLI overrides:
Connect: ${__P(connect.timeout,10000)}Response: ${__P(response.timeout,60000)}# Override timeouts dynamically via CLI propertiesjmeter -n -t testplan.jmx -Jconnect.timeout=5000 -Jresponse.timeout=30000 -l results.jtl -j jmeter.logWhen Read timed out spikes under load:
If long-running requests drop intermittently, verify keep-alive behavior in user.properties:
# Validate idle connections before reuse (milliseconds)httpclient4.validate_after_inactivity=2000# Connection time to live in millisecondshttpclient4.time_to_live=60000For long soak tests on Linux load generators:
# Check current TCP keepalive settingssysctl net.ipv4.tcp_keepalive_timesysctl net.ipv4.tcp_keepalive_intvlsysctl net.ipv4.tcp_keepalive_probes| Resource | Use when |
|---|---|
| Non HTTP response code | Understanding generic client-side sample failures |
| NoHttpResponseException | Server closes socket before sending any bytes |
| HTTP 502/503/504 | Gateway timeouts returned by reverse proxies |
| Thread Calculator | Calibrating concurrency against server response times |
| Properties Cheat Sheet | Interactive reference for JMeter core properties |
connect timed out is typically a network routing, DNS, or firewall issue. Read timed out is almost always a server-side performance bottleneck where the application takes longer to calculate the response than JMeter is configured to wait.
Under light load, the server responds in 200ms. Under heavy concurrency, thread contention, database connection pool exhaustion, and CPU saturation cause response times to exceed the timeout threshold (e.g. 5000ms).
No. Raising the timeout merely prevents JMeter from failing the sample early. If response times breach your service level agreement (SLA), you must optimize the server code, queries, or server capacity.