jmeter icon indicating copy to clipboard operation
jmeter copied to clipboard

First HTTP request in Thread Group has twice latency than other HTTP request

Open saubhagya23 opened this issue 1 year ago • 3 comments

Expected behavior

We created a thread group for testing APIs. The configurations we used are as follows: Number of Threads: 50 Ramp-up Period: 0 Loop Count: 1 Startup delay: 0

We generated Aggregate Report but the first request always has double the response time and latency time as that of the other http request whereas on browser it is similar to other api requests. (Please refer the screenshot) image

Even when we interchange the order of apis in JMeter, the first request always takes double the response time and latency time. (Please refer the screenshot) image

We have also added HTTP Cache Manager to clear cache if any but are still getting the same results.

Expected behaviour: The latency and response time should be similar to that of the web application.

Please help us resolve this issue at the earliest.

Actual behavior

The latency and response time for the first HTTP request is almost double the rest of the HTTP requests and not at all similar that of the web application.

Steps to reproduce the problem

  • Download and install Apache JMeter
  • Create test plan
  • Create thread group with above configuration
  • Copy api as (bash) from web.
  • Go to Tools>Import from cURL
  • Add multiple apis.
  • Add Aggregate report
  • Execute test plan

JMeter Version

5.6.3

Java Version

openjdk version"11" 2018-09-25

OS Version

No response

saubhagya23 avatar Jun 06 '24 10:06 saubhagya23

Please provide us with a solution to this as we couldn't find a solution to this.

saubhagya23 avatar Jun 11 '24 05:06 saubhagya23

Just an idea: the 1st request is the one that opens a connection to the server and the connection pool is setup, the URL is cached, etc (I assume you use HTTPClient4 implementation). The rest of the connections might be re-used from the pool next, that's why you don't see a penalty anymore. You should be able to see the connection times in JTL provided you selected in the Listener of choice to also 'Save Connect time'; you can also see this info in the 'View Results in Table' Listener.

KingRabbid avatar Jul 10 '24 10:07 KingRabbid

try to run as Non-Gui mode

linvaux avatar Aug 08 '24 05:08 linvaux