I try to test my application in 2 scopes

  1. Default ASP.NET Core Web API weatherforecast
  2. Default ASP.NET Core Minimal API weatherforecast

The test results are amazing!

ASP.NET Core Web API:

  scenarios: (100.00%) 1 scenario, 50 max VUs, 10m30s max duration (incl. graceful stop):
           * default: 10000 iterations shared among 50 VUs (maxDuration: 10m0s, gracefulStop: 30s)


     ✓ Success!

     checks.........................: 100.00% ✓ 10000      ✗ 0
     data_received..................: 4.6 MB  48 kB/s
     data_sent......................: 498 kB  5.2 kB/s
     http_req_blocked...............: avg=1.14ms   min=0s       med=0s       max=342.53ms p(90)=0s       p(95)=0s
     http_req_connecting............: avg=6.6µs    min=0s       med=0s       max=3ms      p(90)=0s       p(95)=0s
       { expected_response:true }...: avg=478.97ms min=113.42ms med=467.31ms max=905.99ms p(90)=584.76ms p(95)=636.13ms
     http_req_failed................: 0.00%   ✓ 0          ✗ 10000
     http_req_receiving.............: avg=154.77µs min=0s       med=0s       max=89.79ms  p(90)=629.73µs p(95)=846.5µs
     http_req_sending...............: avg=24.48µs  min=0s       med=0s       max=1.37ms   p(90)=0s       p(95)=0s
     http_req_tls_handshaking.......: avg=1.1ms    min=0s       med=0s       max=333.45ms p(90)=0s       p(95)=0s
     http_req_waiting...............: avg=478.79ms min=112.21ms med=467.16ms max=905.99ms p(90)=584.76ms p(95)=635.67ms
     http_reqs......................: 10000   104.010128/s
     iteration_duration.............: avg=480.15ms min=189.12ms med=467.43ms max=952.73ms p(90)=586.82ms p(95)=639.5ms
     iterations.....................: 10000   104.010128/s
     vus............................: 32      min=32       max=50
     vus_max........................: 50      min=50       max=50


running (01m36.1s), 00/50 VUs, 10000 complete and 0 interrupted iterations
default ✓ [======================================] 50 VUs  01m36.1s/10m0s  10000/10000

ASP.NET Core Minimal API:

  scenarios: (100.00%) 1 scenario, 50 max VUs, 10m30s max duration (incl. graceful stop):
           * default: 10000 iterations shared among 50 VUs (maxDuration: 10m0s, gracefulStop: 30s)


     ✓ Success!

     checks.........................: 100.00% ✓ 10000       ✗ 0
     data_received..................: 4.5 MB  2.2 MB/s
     data_sent......................: 498 kB  252 kB/s
     http_req_blocked...............: avg=495.97µs min=0s     med=0s     max=126.87ms p(90)=0s       p(95)=0s
     http_req_connecting............: avg=6.7µs    min=0s     med=0s     max=2.99ms   p(90)=0s       p(95)=0s
     http_req_duration..............: avg=9.33ms   min=2.95ms med=8.68ms max=37.69ms  p(90)=10.54ms  p(95)=10.9ms
       { expected_response:true }...: avg=9.33ms   min=2.95ms med=8.68ms max=37.69ms  p(90)=10.54ms  p(95)=10.9ms
     http_req_failed................: 0.00%   ✓ 0           ✗ 10000
     http_req_receiving.............: avg=62.85µs  min=0s     med=0s     max=1.02ms   p(90)=257.76µs p(95)=512.6µs
     http_req_sending...............: avg=27.64µs  min=0s     med=0s     max=1.51ms   p(90)=0s       p(95)=253.58µs
     http_req_tls_handshaking.......: avg=456.24µs min=0s     med=0s     max=118.87ms p(90)=0s       p(95)=0s
     http_req_waiting...............: avg=9.24ms   min=2.95ms med=8.59ms max=37.69ms  p(90)=10.44ms  p(95)=10.82ms
     http_reqs......................: 10000   5048.479794/s
     iteration_duration.............: avg=9.88ms   min=2.95ms med=8.73ms max=138.38ms p(90)=10.61ms  p(95)=10.99ms
     iterations.....................: 10000   5048.479794/s
     vus............................: 50      min=50        max=50
     vus_max........................: 50      min=50        max=50


running (00m02.0s), 00/50 VUs, 10000 complete and 0 interrupted iterations
default ✓ [======================================] 50 VUs  00m02.0s/10m0s  10000/10000 shared iters

My k6 code :

import http from 'k6/http';
import { check } from 'k6';

export let options = {
    vus: 50,
    iterations: 10000

}

export default () => {
     var aaa = 'https://localhost:7281/weatherforecast';
     const res = http.get(aaa);

    check(res, { 'Success!': (r) => r.status == 200 });
};

Looking at these results, there's a significant difference in execution times between the two setups. Any thoughts on why this might be happening?

0

There are 0 best solutions below