Bisonai / orakl

Official Oracle of Kaia Blockchain
https://orakl.network
MIT License
71 stars 15 forks source link

(DAL) stress test dal #1895

Closed nick-bisonai closed 2 months ago

nick-bisonai commented 2 months ago

stress test dal with bulk traffic k6 recommended

nick-bisonai commented 2 months ago

Sharing the result through the comment

export const options = { stages: [ { duration: "30s", target: 40 }, { duration: "1m30s", target: 20 }, { duration: "20s", target: 0 }, ], };

export default function () { const params = { headers: { "X-Api-Key": "", }, };

const responses = http.batch([ [ "GET", "http://dal.baobab.orakl.network/latest-data-feeds/transpose/all", null, params, ], [ "GET", "http://dal.baobab.orakl.network/latest-data-feeds/all", null, params, ], ["GET", "http://dal.baobab.orakl.network/symbols", null, params], ]);

check(responses[0], { "status was 200": (res) => res.status === 200, }); check(responses[1], { "status was 200": (res) => res.status === 200, }); check(responses[2], { "status was 200": (res) => res.status === 200, }); }


- result

k6 run script.js

      /\      |‾‾| /‾‾/   /‾‾/
 /\  /  \     |  |/  /   /  /
/  \/    \    |     (   /   ‾‾\

/ \ | |\ \ | (‾) | / __ \ || __\ ___/ .io

 execution: local
    script: script.js
    output: -

 scenarios: (100.00%) 1 scenario, 40 max VUs, 2m50s max duration (incl. graceful stop):
          * default: Up to 40 looping VUs for 2m20s over 3 stages (gracefulRampDown: 30s, gracefulStop: 30s)

 ✓ status was 200

 checks.........................: 100.00% ✓ 14229      ✗ 0
 data_received..................: 280 MB  2.0 MB/s
 data_sent......................: 2.0 MB  15 kB/s
 http_req_blocked...............: avg=100.64µs min=0s       med=1µs      max=173.55ms p(90)=7µs      p(95)=15µs
 http_req_connecting............: avg=61.72µs  min=0s       med=0s       max=22.33ms  p(90)=0s       p(95)=0s
 http_req_duration..............: avg=628.96ms min=148.4ms  med=490.2ms  max=8.1s     p(90)=1.27s    p(95)=1.55s
   { expected_response:true }...: avg=628.96ms min=148.4ms  med=490.2ms  max=8.1s     p(90)=1.27s    p(95)=1.55s
 http_req_failed................: 0.00%   ✓ 0          ✗ 14229
 http_req_receiving.............: avg=147.82ms min=5µs      med=100.62ms max=7.69s    p(90)=333.9ms  p(95)=466.62ms
 http_req_sending...............: avg=10.59µs  min=2µs      med=6µs      max=5.66ms   p(90)=14µs     p(95)=20µs
 http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s
 http_req_waiting...............: avg=481.12ms min=148.22ms med=372.89ms max=7.74s    p(90)=957.25ms p(95)=1.24s
 http_reqs......................: 14229   101.588475/s
 iteration_duration.............: avg=752.24ms min=222.22ms med=582.88ms max=8.1s     p(90)=1.48s    p(95)=1.78s
 iterations.....................: 4743    33.862825/s
 vus............................: 1       min=1        max=40
 vus_max........................: 40      min=40       max=40

running (2m20.1s), 00/40 VUs, 4743 complete and 0 interrupted iterations default ✓ [======================================] 00/40 VUs 2m20s

nick-bisonai commented 2 months ago
image