Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

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

There are some hints in the JMeter documentation that it may, but nothing in the documentation definitively states it.

If it does, is there a way to control the connection pool? For example, can you set the size of the pool?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
472 views
Welcome To Ask or Share your Answers For Others

1 Answer

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

In both cases, connections are pooled per-thread. Connections are NOT shared across threads.

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

When using HttpClient4, JMeter uses an instance of a subclass of PoolingClientConnectionManager on each thread, and it uses PoolingClientConnectonManager's default settings (2 connections per route, and 20 maximum connections).

JMeter does not provide a mechanism for controlling the parameters of the connection pools.

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...