Monochrome Monochrome - 1 year ago 123
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, is Jmeter, is the server. The rest of requests can be only send in a new connection and they are out of session.

Answer Source

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.



Second reason - 'max' Parameter

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


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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download