Relationship between number of iterations completed and performance

I have two app versions. The old version sends some unnecessary API calls to backend from UI, they have been removed in the latest version. I ran a k6 test script against these two versions and got following results for each old and new versions. This script will execute a scenario where 100 VUs will try to run as many iterations as possible for 15 mins.

OLD version:
> http_req_duration … 3.35s, min=16.07s, med=2.36s, max=16.17s, p(90)=8.07s
> http_reqs … 26825, 28.843876/s
> iterations … 848, 0.911821

NEW version:
> http_req_duration … 3.71s, min=15.82s, med=1.41s, max=17.53s, p(90)=10.01s
> http_reqs … 24104, 25.918153/s
> iterations … 962, 1.034404/s

I can observe that no. of iterations has been increased in the latest versions, That means it has run the script more times in the new version than the old. so that according to my understanding, I conclude that page loading time has been increased in new version. Also, number of http_reqs to backend has been descreased (from 26k to 24k) in new version, therefore backend load burden also has been reduced. Can you help me to clarify whether my conclusions are valid or not?
Also, still I can see the http_req_duration is bit high in new version, then how can the new version execute more number of iterations?

Hi there, welcome to the forum :slight_smile:

This would be difficult to answer with certainty without seeing your script and being familiar with your system.

More script iterations could be because of several reasons: you’re doing less work per iteration (e.g. your script is taking a different path in the new version), or there were more shorter duration requests meaning that iterations are shorter. In general I would pay more attention to the http_req_duration metric to determine performance since iterations can be affected by anything else your script is doing besides making HTTP requests.

Your http_req_duration doesn’t look that much better in the new version, but the median value is lower, meaning there were more shorter-duration requests in the new version, which would explain the higher number of iterations. This would usually mean a higher number of requests as well, so I’m not clear why there were less in the new version.

You might also want to compare iteration_duration and add higher percentile stats with k6 run --summary-trend-stats="min,med,avg,max,p(99),p(99.9),p(99.99)" script.js so you can see the outliers. Judging by the p(90) value you also have more longer duration requests, which might explain the lower amount of requests overall.

Like I said, it’s difficult to arrive at a conclusion without knowing more details about your setup and running some more focused tests. Hope this helps.