Harish
Harish

Reputation: 37

The Average response time differs largely while load testing the Same API Endpoint with same load using Jmeter

I am using JMeter to test performance of an API Endpoint. The Number of Threads(users) applied is 100. When I execute the test for the very first time the average response time is 35345 ms. for all the following tests with the same number of threads on the same API Endpoint the average response time is somewhere around 4705 ms.

what is the reason for such a big difference in average response time ? Does JMeter cache any files on the first test and use the same cached files on all following tests ? If yes how do I avoid this ?

I am new to JMeter any help in this regards will be much appreciated.

Upvotes: 0

Views: 1260

Answers (1)

Dmitri T
Dmitri T

Reputation: 168002

JMeter doesn't cache anything when it comes to API testing, it has HTTP Cache Manager which can represent browser cache when it comes to handling embedded resources like images, scripts and styles when it comes to web testing (mimicking HTTP requests send by real browsers) but it is not your case.

So my expectation is that it is something on your application under test side, i.e. it needs to "warm up" its own caches and first few requests are processed longer due to lazy initialization of components on the first access.

So my recommendations are:

  • Make sure you use reasonable ramp-up period so the load increases gradually, this way you will be able to correlate main metrics like response time, hits per second, etc. with the increased load
  • Monitor your application under test health from OS perspective, i.e. CPU, RAM, Swap consumption, etc. You can use JMeter PerfMon Plugin for that
  • Use profiling tools which are relevant for your application to detect "heavy" methods, long-running DB queries, etc.

Upvotes: 2

Related Questions