JMeter是否池HTTP连接? [英] Does JMeter pool HTTP connections?

查看:94
本文介绍了JMeter是否池HTTP连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道在 JMeter HTTP Request采样器连接中使用内置Java HTTP客户端时,可能会或可能不会将其池化,取决于JVM的实现和配置.

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.

但是,使用HttpClient3.1或HttpClient4时,JMeter池连接吗?

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

JMeter文档中有一些提示,也许可以,但是文档中没有明确说明.

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?

推荐答案

在使用HttpClient3.1或HttpClient4时,JMeter会进行一些HTTP连接池.

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.

使用HttpClient3.1时,JMeter使用的实例每个线程上都有SimpleHttpConnectionManager .

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

使用HttpClient4时,JMeter使用

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没有提供控制连接池参数的机制.

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

我不得不去JMeter的源代码才能找到这个答案.请参阅以下链接以供参考(带有2.13标签的代码):

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

注意:此答案适用于JMeter 2.13.对于其他版本的JMeter,答案可能有所不同.

这篇关于JMeter是否池HTTP连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆