테스트 조건

백엔드와 NGINX는 각각 NCP Server의 G1 Compact (1vCPU, 2GB RAM) 을 사용한다.

기준 커밋은 822110c86f4182a2e8e63f121b186804cf417189 다. (feat(BE): rate limiter .env연동 #182)

테스트를 보내는 환경은 서버와 분리되어 있다.

테스트 결과

load test

execution: local
     script: load.js
     output: statsd (localhost:8125)

  scenarios: (100.00%) 1 scenario, 300 max VUs, 10m30s max duration (incl. graceful stop):
           * default: Up to 300 looping VUs for 10m0s over 3 stages (gracefulRampDown: 30s, gracefulStop: 30s)

running (10m04.1s), 000/300 VUs, 32274 complete and 0 interrupted iterations
default ✓ [======================================] 000/300 VUs  10m0s

     █ setup

     data_received..................: 642 MB 1.1 MB/s
     data_sent......................: 59 MB  98 kB/s
     http_req_blocked...............: avg=136.6µs  min=1.75µs   med=5.25µs  max=3.06s    p(90)=6.65µs   p(95)=7.48µs
     http_req_connecting............: avg=106.55µs min=0s       med=0s      max=3.05s    p(90)=0s       p(95)=0s
     http_req_duration..............: avg=49.91ms  min=5.14ms   med=17.53ms max=652.94ms p(90)=150.23ms p(95)=228.51ms
       { expected_response:true }...: avg=49.91ms  min=5.14ms   med=17.53ms max=652.94ms p(90)=150.23ms p(95)=228.51ms
     http_req_failed................: 0.00%  ✓ 0          ✗ 129097
     http_req_receiving.............: avg=79.35µs  min=27.17µs  med=76.93µs max=2.12ms   p(90)=97.83µs  p(95)=108.87µs
     http_req_sending...............: avg=24.56µs  min=8.78µs   med=23.64µs max=3.32ms   p(90)=29.72µs  p(95)=33.65µs
     http_req_tls_handshaking.......: avg=19.34µs  min=0s       med=0s      max=35.59ms  p(90)=0s       p(95)=0s
     http_req_waiting...............: avg=49.81ms  min=5.04ms   med=17.43ms max=652.85ms p(90)=150.13ms p(95)=228.42ms
     http_reqs......................: 129097 213.707392/s
     iteration_duration.............: avg=4.2s     min=780.88ms med=4.15s   max=7.11s    p(90)=4.44s    p(95)=4.52s
     iterations.....................: 32274  53.426434/s
     vus............................: 1      min=1        max=300
     vus_max........................: 300    min=300      max=300

Untitled

예상된 결과로 별 다른 문제를 보이지 않는다.

스트레스 테스트

execution: local
     script: stress.js
     output: statsd (localhost:8125)

  scenarios: (100.00%) 1 scenario, 1200 max VUs, 13m30s max duration (incl. graceful sto
           * default: Up to 1200 looping VUs for 13m0s over 9 stages (gracefulRampDown:

running (13m03.7s), 0000/1200 VUs, 69193 complete and 0 interrupted iterations
default ✓ [======================================] 0000/1200 VUs  13m0s

     █ setup

     data_received..................: 1.4 GB 1.8 MB/s
     data_sent......................: 127 MB 162 kB/s
     http_req_blocked...............: avg=61.28µs  min=1.88µs   med=5.14µs   max=656.65ms p(90)=6.35µs  p(95)=7.11µs
     http_req_connecting............: avg=18.54µs  min=0s       med=0s       max=21.7ms   p(90)=0s      p(95)=0s
     http_req_duration..............: avg=965.22ms min=5.27ms   med=773.36ms max=6.97s    p(90)=2.07s   p(95)=2.69s
       { expected_response:true }...: avg=965.22ms min=5.27ms   med=773.36ms max=6.97s    p(90)=2.07s   p(95)=2.69s
     http_req_failed................: 0.00%  ✓ 0          ✗ 276773
     http_req_receiving.............: avg=77.86µs  min=25.15µs  med=75.68µs  max=8.12ms   p(90)=95.14µs p(95)=104.43µs
     http_req_sending...............: avg=24.3µs   min=8.48µs   med=23.08µs  max=7.71ms   p(90)=28.62µs p(95)=32.34µs
     http_req_tls_handshaking.......: avg=31.96µs  min=0s       med=0s       max=22.41ms  p(90)=0s      p(95)=0s
     http_req_waiting...............: avg=965.12ms min=5.17ms   med=773.25ms max=6.97s    p(90)=2.07s   p(95)=2.69s
     http_reqs......................: 276773 353.149296/s
     iteration_duration.............: avg=7.86s    min=126.53ms med=7.77s    max=16.89s   p(90)=12.23s  p(95)=12.73s
     iterations.....................: 69193  88.287005/s
     vus............................: 6      min=4        max=1200
     vus_max........................: 1200   min=1200     max=1200

Untitled

예상 수용량의 4배까지 올라가는 테스트이나, 리퀘스트 처리율은 400/s 전후.

이터레이션 주기가 길어지긴 했지만 request fail은 발생하지 않았다.

스파이크 테스트

running (6m44.1s), 0000/4200 VUs, 105432 complete and 0 interrupted iterations
default ✓ [======================================] 0000/4200 VUs  6m40s

     █ setup

     data_received..................: 947 MB 2.3 MB/s
     data_sent......................: 94 MB  234 kB/s
     http_req_blocked...............: avg=384.2ms  min=0s     med=4.93µs   max=16.62s   p(90)=1.12s    p(95)=1.38s
     http_req_connecting............: avg=821.36ms min=0s     med=19.25ms  max=15.52s   p(90)=1.07s    p(95)=3.04s
     http_req_duration..............: avg=1.4s     min=0s     med=9.4ms    max=16.47s   p(90)=7.75s    p(95)=8.27s
       { expected_response:true }...: avg=2.4s     min=5.06ms med=145.61ms max=16.47s   p(90)=8.22s    p(95)=8.43s
     http_req_failed................: 41.68% ✓ 84378      ✗ 118020
     http_req_receiving.............: avg=50.72µs  min=0s     med=60.04µs  max=116.28ms p(90)=97.98µs  p(95)=108.13µs
     http_req_sending...............: avg=214.98µs min=0s     med=21.71µs  max=1.2s     p(90)=42.04µs  p(95)=50.26µs
     http_req_tls_handshaking.......: avg=30.03ms  min=0s     med=0s       max=4.69s    p(90)=113.01ms p(95)=221.43ms
     http_req_waiting...............: avg=1.4s     min=0s     med=9.29ms   max=16.47s   p(90)=7.75s    p(95)=8.27s
     http_reqs......................: 202398 500.899409/s
     iteration_duration.............: avg=6.35s    min=5.38ms med=1.31s    max=1m20s    p(90)=23.7s    p(95)=29.91s
     iterations.....................: 105432 260.925634/s
     vus............................: 4      min=0        max=4200
     vus_max........................: 4200   min=4200     max=4200

Untitled

리퀘스트 실패율이 40%까지 상승하는 좋지 않은 결과를 보였다.

서버가 아예 다운되지 않은 것은 다행.