Monochrome Monochrome - 26 days ago 10
HTTP Question

Jmeter close connection before my test finish

I use jmeter HTTP Sampler to test a sequence of HTTP requests and choosed "Use KeepAlive". But a few threads Jmeter closed connection with TCP FIN before all
requests send out.
enter image description here

As the picture shown, 172.19.0.101 is Jmeter,172.19.0.111 is the server. The rest of requests can be only send in a new connection and they are out of session.

Answer

It can be of two reasons:

First reason - timeout

whether timeout is reached (default value is 60 seconds, and configurable. If not configured, it uses the connectionTimeout parameter value in tomcat server).

the default connection timeout of Apache httpd 1.3 and 2.0 is as little as 15 seconds and just 5 seconds for Apache httpd 2.2 and above

I observed that the request got the response after 10 seconds (15 -> 29 seconds) before sending FIN signal to terminate the connection.

References:

  1. https://tools.ietf.org/id/draft-thomson-hybi-http-timeout-01.html#p-timeout
  2. https://en.wikipedia.org/wiki/HTTP_persistent_connection
  3. https://tomcat.apache.org/tomcat-7.0-doc/config/http.html

Second reason - 'max' Parameter

May be it reached the number of requests that can be sent on a single Persistent Connetion.

  1. https://tools.ietf.org/id/draft-thomson-hybi-http-timeout-01.html#p-max

Set Implementation in HTTP Samplers to HTTPClient4 and try.

From JMeter HTTP Sampler documentation.

JMeter sets the Connection: keep-alive header. This does not work properly with the default HTTP implementation, as connection re-use is not under user-control. It does work with the Apache HttpComponents HttpClient implementations.

Comments