Does JMeter support HTTP connections?

I know that when using the built-in Java HTTP client in JMeter HTTP Request , sampler connections may or may not be combined depending on the JVM implementation and configuration.

However, are there JMeter pool connections when using HttpClient3.1 or HttpClient4?

There are a few hints in the JMeter documentation, but there is no definitive description in the documentation.

If so, is there a way to manage the connection pool? For example, can you set the size of the pool?

+6
source share
2 answers

JMeter does some HTTP connection pooling when using HttpClient3.1 or HttpClient4.

In both cases, the connections are combined into threads. Connections are not shared between threads.

When using HttpClient3.1, JMeter uses an instance of SimpleHttpConnectionManager for each thread.

When using HttpClient4, JMeter uses an instance of the PoolingClientConnectionManager subclass for each thread, and it uses the default settings for the PoolingClientConnectonManager (2 connections for each route and 20 maximum connections).

JMeter does not provide a mechanism for managing connection pool settings.

I had to go to the JMeter source code to find this answer. See the following links for reference (code with tag 2.13):

Note: this answer is accurate for JMeter 2.13. The answer may differ for other versions of JMeter.

+8
source

Update for JMeter 3: in HTTPSampler configuration you can use entries

  <boolProp name="HTTPSampler.concurrentDwn">true</boolProp> <stringProp name="HTTPSampler.concurrentPool">10</stringProp> 

to specify the connection pool size according to this code fragment (from http://svn.apache.org/viewvc/jmeter/tags/v3_0/src/protocol/http/org/apache/jmeter/protocol/http/sampler/ HTTPHC4Impl.java?view=markup line 785ff)

  if(this.testElement.isConcurrentDwn()) { try { int maxConcurrentDownloads = Integer.parseInt(this.testElement.getConcurrentPool()); connManager.setDefaultMaxPerRoute(Math.max(maxConcurrentDownloads, connManager.getDefaultMaxPerRoute())); } catch (NumberFormatException nfe) { // no need to log -> will be done by the sampler } } } 

Configuration through JMeter UI is a bit bizarre:

Switch the HTTP probe configuration view to “Advanced,” check “Get all embedded resources,” then “Parallel downloads,” and enter a number. After that, you can turn off "Get all embedded resources" if you do not want JMeter to process your responses for images

+1
source

All Articles