在 JMeter Connect 中,某些记录的 apperas 导致经过的时间较长

In JMeter Connect time apperas for certain records results in high elapsed time

我正在 运行 有 20 个并发用户的 JMeter 测试(已启用使用 kee alive)。所有 20 个具有不同登录 ID 的用户都尝试登录(第一次测试)并创建记录(第二次测试)。在创建记录时,我观察到大多数创建记录的连接时间为“0”,但某些记录(比如 5/20)的连接时间为 21000 毫秒,因此由于仅 5 个请求的耗用时间与其他请求相比就太高了15 个请求。为什么只有 5 个用户会发生这种情况?

我们不知道,根据 JMeter Glossary

Connect Time. JMeter measures the time it took to establish the connection, including SSL handshake. Note that connect time is not automatically subtracted from latency. In case of connection error, the metric will be equal to the time it took to face the error, for example in case of Timeout, it should be equal to connection timeout.

所以它更像是一个网络指标,指示 JMeter 与服务器建立连接需要多长时间。

您需要检查:

  1. 您的网络适配器统计信息,可能是它没有足够的带宽来发送 20 个并发请求
  2. 您的应用程序 connection pool 设置,例如,如果它在池中有 15 个连接,则剩余 5 个将被放入队列并等待连接可用。
  3. 检查您的服务器基线健康指标,例如 CPU、RAM 等(可以使用 JMeter PerfMon Plugin 完成),因为您的服务器可能缺乏资源来为所有连接提供服务同时
  4. 确保遵循 JMeter Best Practices,因为 JMeter 可能超载并且无法足够快地发送请求