Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Performance Jmeter和Postman的响应时间差_Performance_Api_Jmeter_Postman - Fatal编程技术网

Performance Jmeter和Postman的响应时间差

Performance Jmeter和Postman的响应时间差,performance,api,jmeter,postman,Performance,Api,Jmeter,Postman,我试图测试一个API Get方法,当我在postman中为1000条记录运行相同的API时,响应时间为4秒(在windows 7中安装了postman并运行了测试),而在JMeter中需要22秒,你知道这是什么原因吗 JMeter运行所遵循的步骤: 图形用户界面模式 非GUI模式 邮递员和JMeter都在同一个系统/网络中 以下是Jmeter结果: Thread Name: Test/TestAPI 1-1 Sample Start: 2018-05-22 17:15:00 IST Load t

我试图测试一个API Get方法,当我在postman中为1000条记录运行相同的API时,响应时间为4秒(在windows 7中安装了postman并运行了测试),而在JMeter中需要22秒,你知道这是什么原因吗

JMeter运行所遵循的步骤:

  • 图形用户界面模式
  • 非GUI模式
  • 邮递员和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的HTTP头
    Accept Encoding gzip,deflate

    遵循JMeter的方法以获得最佳性能,主要的方法是不使用侦听器:

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

    使用尽可能少的听众;如果如上所述使用-l标志,则可以删除或禁用它们


    你能提供更多的细节吗?JMeter的结果显示了什么?我应该提供什么样的信息?请让我知道。Jmeter结果显示200 OK,平均时间22112毫秒(22秒),如果我运行与邮递员相同的API,则显示为4720毫秒(4秒)。Jmeter版本4.0当您将Jmeter爬升周期(在线程组中)设置为1000时会发生什么?仍然需要几乎相同的秒数,即现在28秒,线程数:1,爬升:1000,循环计数:1,我的系统配置:i3 CPU@3.7 GH 8 GB Ram,64位您在Jmeter中缺少头
    内容编码