ChakshuGautam / geoquery.in

Service to get Location from ipv4 and ipv6
https://geoquery.in
29 stars 77 forks source link

K6 API Benchmarks - Part 1/3 #163

Open 35C4n0r opened 2 months ago

35C4n0r commented 2 months ago

Description

This issue tracks the implementation of benchmarking GET endpoints using K6 for the application.

Implementation Details

Product Name

GeoIP

Project Name

GeoIP

Organization Name

SamagraX

Domain

NA

Tech Skills Needed

K6, Node JS

Category

Benchmarking

Mentor(s)

@dhruv-1001 @35C4n0r

Complexity

High

35C4n0r commented 2 months ago

Before Migrations

image

$ k6 run --out=cloud benchmark.js 

          /\      |‾‾| /‾‾/   /‾‾/
     /\  /  \     |  |/  /   /  /
    /  \/    \    |     (   /   ‾‾\
   /          \   |  |\  \ |  (‾)  |
  / __________ \  |__| \__\ \_____/ .io

     execution: local
        script: benchmark.js
        output: cloud (https://jaykumar2021.grafana.net/a/k6-app/runs/3175657)

     scenarios: (100.00%) 1 scenario, 10 max VUs, 1m0s max duration (incl. graceful stop):
              * default: 10 looping VUs for 30s (gracefulStop: 30s)

     ✓ status is 200
     ✓ response text is correct
     ✓ response contains lat
     ✓ first response is success
     ✓ second response is fail
     ✓ response contains district

     checks.........................: 100.00% ✓ 336      ✗ 0
     data_received..................: 69 kB   2.0 kB/s
     data_sent......................: 18 kB   516 B/s
     http_req_blocked...............: avg=85.13µs  min=0s   med=0s      max=6.45ms p(90)=0s    p(95)=0s
     http_req_connecting............: avg=43.88µs  min=0s   med=0s      max=6.45ms p(90)=0s    p(95)=0s
     http_req_duration..............: avg=2.09s    min=0s   med=56.94ms max=13.72s p(90)=6.61s p(95)=8.83s
       { expected_response:true }...: avg=2.09s    min=0s   med=56.94ms max=13.72s p(90)=6.61s p(95)=8.83s
     http_req_failed................: 0.00%   ✓ 0        ✗ 147
     http_req_receiving.............: avg=176.5µs  min=0s   med=0s      max=7.66ms p(90)=0s    p(95)=798.67µs
     http_req_sending...............: avg=461.59µs min=0s   med=0s      max=6.45ms p(90)=0s    p(95)=6.45ms
     http_req_tls_handshaking.......: avg=0s       min=0s   med=0s      max=0s     p(90)=0s    p(95)=0s
     http_req_waiting...............: avg=2.09s    min=0s   med=54.51ms max=13.72s p(90)=6.61s p(95)=8.83s
     http_reqs......................: 147     4.255701/s
     iteration_duration.............: avg=15.69s   min=3.1s med=16.4s   max=16.71s p(90)=16.7s p(95)=16.71s
     iterations.....................: 21      0.607957/s
     vus............................: 1       min=1      max=10
     vus_max........................: 10      min=10     max=10

running (0m34.5s), 00/10 VUs, 21 complete and 0 interrupted iterations                                                                                                                                                                            
default ✓ [======================================] 10 VUs  30s                                                  
35C4n0r commented 2 months ago

After Migrations

image

$ k6 run --out=cloud benchmark.js 

          /\      |‾‾| /‾‾/   /‾‾/
     /\  /  \     |  |/  /   /  /
    /  \/    \    |     (   /   ‾‾\
   /          \   |  |\  \ |  (‾)  |
  / __________ \  |__| \__\ \_____/ .io

     execution: local
        script: benchmark.js
        output: cloud (https://jaykumar2021.grafana.net/a/k6-app/runs/3175716)

     scenarios: (100.00%) 1 scenario, 10 max VUs, 1m0s max duration (incl. graceful stop):
              * default: 10 looping VUs for 30s (gracefulStop: 30s)

     ✓ status is 200
     ✓ response text is correct
     ✓ response contains lat
     ✓ first response is success
     ✓ second response is fail
     ✓ response contains district

     checks.........................: 100.00% ✓ 4256     ✗ 0
     data_received..................: 865 kB  28 kB/s
     data_sent......................: 226 kB  7.3 kB/s
     http_req_blocked...............: avg=11.63µs min=0s    med=0s     max=2.75ms   p(90)=0s      p(95)=0s
     http_req_connecting............: avg=3.93µs  min=0s    med=0s     max=1.1ms    p(90)=0s      p(95)=0s
     http_req_duration..............: avg=18.91ms min=0s    med=4.92ms max=623.18ms p(90)=46.47ms p(95)=79.71ms
       { expected_response:true }...: avg=18.91ms min=0s    med=4.92ms max=623.18ms p(90)=46.47ms p(95)=79.71ms
     http_req_failed................: 0.00%   ✓ 0        ✗ 1862
     http_req_receiving.............: avg=162.6µs min=0s    med=0s     max=14.57ms  p(90)=0s      p(95)=829.48µs
     http_req_sending...............: avg=40.76µs min=0s    med=0s     max=19.56ms  p(90)=0s      p(95)=0s
     http_req_tls_handshaking.......: avg=0s      min=0s    med=0s     max=0s       p(90)=0s      p(95)=0s
     http_req_waiting...............: avg=18.7ms  min=0s    med=4.57ms max=623.18ms p(90)=46.15ms p(95)=79.71ms
     http_reqs......................: 1862    59.87969/s
     iteration_duration.............: avg=1.15s   min=1.04s med=1.1s   max=1.79s    p(90)=1.27s   p(95)=1.4s
     iterations.....................: 266     8.554241/s
     vus............................: 4       min=4      max=10
     vus_max........................: 10      min=10     max=10

running (0m31.1s), 00/10 VUs, 266 complete and 0 interrupted iterations                                                                                                                                                                           
default ✓ [======================================] 10 VUs  30s  
zenc0derr commented 1 month ago

Hi @35C4n0r, I would like to contribute on this issue

rohansen856 commented 6 days ago

hi @35C4n0r i see that the issue has been dead for quite a while. I have complete setup of the grafana k6 server and also setup the geoquery codebase. I would like to work on this issue and generate benchmarkings for the api endpoints. Do let me know if any discussion is needed. thank you.