Configuring response timeout in Apache JMeter

前端 未结 2 1583
我寻月下人不归
我寻月下人不归 2020-12-05 09:59

I am trying to check if a particular HTTP request\'s response time is over 30 seconds, and if it is, then mark it as failed and stop the thread. Because now sometimes I can

相关标签:
2条回答
  • 2020-12-05 10:33

    Socket/Connect and Read/Response timeouts can be set from Http Request Defaults section at jmeter GUI. See sample:

    Connect timeout: 3 seconds
    Response timeout: 20 seconds.

    0 讨论(0)
  • 2020-12-05 10:58

    For your need, an assertion is not the right solution as it will only mark the request as failed but it will wait.

    The right option is a response timeout.

    Regarding the 3rd point

    1. os_sampler.poll_for_timeout=x => not for http, see:

      • https://github.com/apache/jmeter/blob/master/bin/jmeter.properties
    2. http.socket.timeout=x => applies to all requests using HttpClient4 or 3, see:

      • https://github.com/apache/jmeter/blob/master/bin/hc.parameters
    3. httpclient.timeout=x => Same, see:

      • https://github.com/apache/jmeter/blob/master/bin/jmeter.properties

    I think the best option is to use 1. , if you want those values to apply to all requests, just use Http Request Defaults element:

    • https://jmeter.apache.org/usermanual/component_reference.html#HTTP_Request_Defaults

    If you're looking to learn jmeter correctly, this book will help you.

    0 讨论(0)
提交回复
热议问题