Hi, JMeter uses keep-alive connections, but the problem is that JMeter HTTP Client has a "time_to_live" property for connections and it's by default set to 2 seconds.
It's configurable from jmeter.properties file. See following description in jmeter.properties file (Also see: http://jmeter.apache.org/usermanual/properties_reference.html#httpclient4) *# TTL (in Milliseconds) represents an absolute value. # No matter what, the connection will not be re-used beyond its TTL. httpclient4.time_to_live=2000* After increasing this value, I see fixed set of connections from JMeter. If we don't increase this, the JMeter will anyway close connections after 2 seconds and we see a lot of sockets created in the JMeter instance. Thanks! Best Regards, On Thu, Jul 6, 2017 at 10:14 AM, Malith Jayasinghe < [email protected]> wrote: > Thanks a lot for the reply. We are using JMETER 3.2 and we set > the following property in the jmeter script. > > <boolProp name="HTTPSampler.use_keepalive">true</boolProp> > Does JMETER create a new connection each time it sends a new request or > does it re-use the connection? > > > Test details: > > It is just simple HTTP performance test to test a NETTY server. NETTY > server sends the message back to the client (i.e. JMETER) > See below for more details. > > <stringProp name="HTTPSampler.domain">xxxxxxxxx</stringProp> > > <stringProp name="HTTPSampler.port">8080</stringProp> > > <stringProp name="HTTPSampler.protocol">http</stringProp> > > <stringProp name="HTTPSampler.contentEncoding"></stringProp> > > <stringProp name="HTTPSampler.path">/passthrough/passthrough > </stringProp> > > <stringProp name="HTTPSampler.method">POST</stringProp> > > <boolProp name="HTTPSampler.follow_redirects">true</boolProp> > > <boolProp name="HTTPSampler.auto_redirects">false</boolProp> > > <boolProp name="HTTPSampler.use_keepalive">true</boolProp> > > <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> > > <stringProp name="HTTPSampler.embedded_url_re"></stringProp> > > <stringProp name="HTTPSampler.implementation">HttpClient4 > </stringProp> > > <stringProp name="HTTPSampler.connect_timeout"></stringProp> > > <stringProp name="HTTPSampler.response_timeout"></stringProp> > > regards > > Malith > > > > > > On Thu, Jul 6, 2017 at 1:24 AM, Felix Schumacher < > [email protected]> wrote: > > > > > > > Am 5. Juli 2017 10:13:25 MESZ schrieb Malith Jayasinghe < > > [email protected]>: > > >While testing with JMETER with fixed number of concurrent users, we > > >have > > >noticed that the number of open connections varies over time. Note that > > >we > > >have specified to re-use connections (i.e. keep alive = true). However, > > >it > > >seems that JMETER does not re-reuse connections rather close a > > >connection > > >and create a new connection each time This behavior is not noticed in > > >other > > >tools (e.g. WRK) > > > > > >We were wondering why this is the case? and if there is a way to fix > > >this > > >issue > > > > Can you give us a bit more information, like the version of JMeter and > > some details of your test? > > > > In version 3.1 there was a bug that could lead to wrong keepalive > > behavior. See https://bz.apache.org/bugzilla/show_bug.cgi?id=60690 > > > > Regards, > > Felix > > > > > > > >The following are some results we get when we test with 2000 concurrent > > >users. > > > > > >*ubuntu@ip-x*:*~*$ ss -tn | grep :8080 | grep ESTAB | wc -l > > > > > >1710 > > > > > >*ubuntu@ip-x**~*$ ss -tn | grep :8080 | grep ESTAB | wc -l > > > > > >2000 > > > > > >*ubuntu@ip-x*:*~*$ ss -tn | grep :8080 | grep ESTAB | wc -l > > > > > >1900 > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > > -- Isuru Perera about.me/chrishantha
