테스트 조건

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

기준 커밋은 94d7f524f214dfb5a6a884a3d7f2445f1e40809f 다. (Update README.md)

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

테스트 결과

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 (10m03.4s), 000/300 VUs, 33049 complete and 0 interrupted iterations
default ✓ [======================================] 000/300 VUs  10m0s

     █ setup

     data_received..................: 682 MB 1.1 MB/s
     data_sent......................: 61 MB  100 kB/s
     http_req_blocked...............: avg=42.04µs min=1.92µs  med=5.32µs  max=1.25s    p(90)=6.83µs  p(95)=7.68µs
     http_req_connecting............: avg=10.26µs min=0s      med=0s      max=22.56ms  p(90)=0s      p(95)=0s
     http_req_duration..............: avg=25.73ms min=4.39ms  med=8.95ms  max=652.76ms p(90)=47.44ms p(95)=136.51ms
       { expected_response:true }...: avg=25.73ms min=4.39ms  med=8.95ms  max=652.76ms p(90)=47.44ms p(95)=136.51ms
     http_req_failed................: 0.00%  ✓ 0          ✗ 132197
     http_req_receiving.............: avg=77.56µs min=25.37µs med=75.16µs max=2.15ms   p(90)=96.06µs p(95)=106.48µs
     http_req_sending...............: avg=24.69µs min=8.08µs  med=23.66µs max=1.74ms   p(90)=30.18µs p(95)=34.4µs
     http_req_tls_handshaking.......: avg=16.74µs min=0s      med=0s      max=31.87ms  p(90)=0s      p(95)=0s
     http_req_waiting...............: avg=25.63ms min=4.3ms   med=8.85ms  max=652.64ms p(90)=47.35ms p(95)=136.42ms
     http_reqs......................: 132197 219.098265/s
     iteration_duration.............: avg=4.1s    min=1.34s   med=4.05s   max=4.79s    p(90)=4.26s   p(95)=4.32s
     iterations.....................: 33049  54.774152/s
     vus............................: 1      min=0        max=300
     vus_max........................: 300    min=300      max=300

Untitled

p(90) duration 의 값이 약 150ms 에서 47ms로, 1/3 으로 줄었다.

Stress Test

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

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

running (13m05.4s), 0000/1200 VUs, 83509 complete and 0 interrupted iterations
default ✓ [======================================] 0000/1200 VUs  13m0s

     █ setup

     data_received..................: 4.6 GB 5.8 MB/s
     data_sent......................: 153 MB 195 kB/s
     http_req_blocked...............: avg=203.2µs  min=2µs     med=5.27µs   max=3.06s    p(90)=6.37µs  p(95)=7.08µs
     http_req_connecting............: avg=123.5µs  min=0s      med=0s       max=3.04s    p(90)=0s      p(95)=0s
     http_req_duration..............: avg=625.53ms min=4.3ms   med=386.04ms max=5.97s    p(90)=1.59s   p(95)=1.99s
       { expected_response:true }...: avg=625.53ms min=4.3ms   med=386.04ms max=5.97s    p(90)=1.59s   p(95)=1.99s
     http_req_failed................: 0.00%  ✓ 0          ✗ 334037
     http_req_receiving.............: avg=14.34ms  min=24.77µs med=77.24µs  max=1.81s    p(90)=42.43ms p(95)=76.33ms
     http_req_sending...............: avg=31.61µs  min=8.13µs  med=23.28µs  max=46.35ms  p(90)=29.09µs p(95)=32.96µs
     http_req_tls_handshaking.......: avg=65.71µs  min=0s      med=0s       max=413.24ms p(90)=0s      p(95)=0s
     http_req_waiting...............: avg=611.15ms min=4.25ms  med=373.89ms max=5.95s    p(90)=1.56s   p(95)=1.95s
     http_reqs......................: 334037 425.308425/s
     iteration_duration.............: avg=6.5s     min=2.02s   med=6.19s    max=14.47s   p(90)=9.94s   p(95)=10.52s
     iterations.....................: 83509  106.326788/s
     vus............................: 9      min=0        max=1200
     vus_max........................: 1200   min=1200     max=1200

Untitled

평균 duration이 960ms에서 625ms로, p(90) duration이 2.07s에서 1.59s로, 약 7~80%로 줄어든 모습을 보여준다.

Spike Test

running (6m44.4s), 0000/4200 VUs, 37396 complete and 264 interrupted iterations
default ✓ [======================================] 0000/4200 VUs  6m40s

     █ setup

     data_received..................: 2.0 GB 4.9 MB/s
     data_sent......................: 73 MB  181 kB/s
     http_req_blocked...............: avg=131.04ms min=0s     med=5.62µs  max=17.11s p(90)=256.84ms p(95)=1.11s
     http_req_connecting............: avg=102.27ms min=0s     med=0s      max=11.29s p(90)=36.66ms  p(95)=1.03s
     http_req_duration..............: avg=3.61s    min=0s     med=71.3ms  max=1m0s   p(90)=13.57s   p(95)=18.44s
       { expected_response:true }...: avg=3.72s    min=4.26ms med=99.12ms max=44.73s p(90)=13.8s    p(95)=18.64s
     http_req_failed................: 4.24%  ✓ 5852       ✗ 131871
     http_req_receiving.............: avg=70.9ms   min=0s     med=80.67µs max=17.5s  p(90)=50.53ms  p(95)=186.33ms
     http_req_sending...............: avg=11.05ms  min=0s     med=25.12µs max=33.23s p(90)=46.79µs  p(95)=57.27µs
     http_req_tls_handshaking.......: avg=31.4ms   min=0s     med=0s      max=16.4s  p(90)=48.51ms  p(95)=179.77ms
     http_req_waiting...............: avg=3.53s    min=0s     med=63.39ms max=1m0s   p(90)=12.9s    p(95)=18.16s
     http_reqs......................: 137723 340.573503/s
     iteration_duration.............: avg=17.31s   min=6.25ms med=4.23s   max=1m51s  p(90)=44.51s   p(95)=51.86s
     iterations.....................: 37396  92.476106/s
     vus............................: 2      min=0        max=4200
     vus_max........................: 4200   min=4200     max=4200

Untitled

평균 duration이 4.1s에서 3.61s로, p(90) duration이 14s에서 13.57s 로 줄었다.

부하가 클 수록 redis 캐싱으로 인한 향상 폭이 줄어드는 것이 확인된다.