【问题标题】:Response time difference in Jmeter and PostmanJmeter 和 Postman 的响应时间差
【发布时间】:2018-11-01 02:28:55
【问题描述】:

当我在邮递员中为 1000 条记录运行相同的 API 时,我正在尝试测试 API Get 方法,响应时间为 4 秒(在 Windows 7 中安装邮递员并运行测试),而在 JMeter 中则需要 22 秒,知道这可能是什么原因吗?

JMeter 运行的步骤:

  1. 图形界面模式
  2. 非 GUI 模式

Postman 和 JMeter 在同一个系统/网络中。

下面是Jmeter结果:

Thread Name: Test/TestAPI 1-1
Sample Start: 2018-05-22 17:15:00 IST
Load time: **21406** // this is the issue , same in postman taking only 4712 ms
Connect Time: 425
Latency: 1990
Size in bytes: 3962439
Sent bytes:1130
Headers size in bytes: 175
Body size in bytes: 3962264
Sample Count: 1
Error Count: 0
Data type ("text"|"bin"|""): text
Response code: 200
Response message: OK
Response headers:HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
api-supported-versions: 1
Date: Tue, 22 May 2018 11:45:06 GMT
Content-Length: 3958179
Server: Web Server
HTTPSampleResult fields:
ContentType: application/json; charset=utf-8
DataEncoding: utf-8

邮差结果:

api-supported-versions →1
content-encoding →gzip
content-type →application/json; charset=utf-8
date →Tue, 22 May 2018 12:00:11 GMT
server →Web Server
transfer-encoding →chunked
vary →Accept-Encoding

【问题讨论】:

  • 您能否提供更多详细信息,以及JMeter结果显示什么?
  • 我应该提供什么样的信息?请告诉我。 Jmeter 结果显示 200 OK,平均时间为 22112 毫秒(22 秒),如果我运行相同的 API,邮递员显示为 4720 毫秒(4 秒)。 Jmeter 4.0版
  • 当您在 JMeter 加速周期(在线程组中)设置为 1000 时会发生什么?
  • 仍然需要几乎相同的秒数,即现在 28 秒,线程数:1,Ramp Up:1000,循环计数:1,我的系统配置:i3 CPU @ 3.7 GH 8 GB Ram,64 位
  • 您在 JMeter 中缺少标题 content-encoding

标签: performance api jmeter postman performance-testing


【解决方案1】:

您需要比较类似的请求。在您的情况下,至少缺少 1 个标头。添加到 JMeter 的 HTTP Header Accept-Encoding gzip,deflate

关注JMeter的Best Practices以获得最佳性能,主要是不要使用监听器:

使用非GUI模式:jmeter -n -t test.jmx -l test.jtl

尽可能少地使用监听器;如果使用上面的 -l 标志,它们都可以被删除或禁用。

【讨论】:

    猜你喜欢
    • 2017-05-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多