Does JMeter pool HTTP connections?

后端 未结 2 1677
北恋
北恋 2021-01-04 19:51

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 c

2条回答
  •  孤街浪徒
    2021-01-04 20:05

    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):

    • HTTPHC3Impl.java
    • HTTPHC4Impl.java
    • MeasuringConnectionManager.java

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

提交回复
热议问题