아래 두 가지 지표로 평가를 함.
Latency를 줄이는 것
)Throughput을 높이는 것
)Throughput
은 네트워크에서 초당 실제로 처리되는 패킷의 양을 나타내는 실용적인 지표Bandwidth
은 네트워크에서 잠재적으로 동시에 전송될 수 있는 데이터의 최대치사용툴: Artillery
# 설치
npm install artillery
./node_modules/.bin/artillery
./node_modules/.bin/artillery dino
# -c : 10명이 -n 20번 씩 => 200번
./node_modules/.bin/artillery quick http://localhost:3000/team/players -c 10 -n 20
그 외 옵션
-c, --count=<value>
c 10
은 동시에 10개의 가상 사용자를 생성하라는 의미-k, --insecure
-n, --num=<value>
n 20
은 각 가상 사용자가 20개의 요청을 보내야 함을 의미-o, --output=<value>
o report.json
은 테스트 결과를 report.json
파일에 저장하라는 의미-q, --quiet
--------------------------------------
Metrics for period to: 01:58:20(+0900) (width: 1.057s)
--------------------------------------
http.codes.200: ................................................................ 200
http.downloaded_bytes: ......................................................... 141400
http.request_rate: ............................................................. 194/sec
http.requests: ................................................................. 200
http.response_time:
min: ......................................................................... 5
max: ......................................................................... 27
mean: ........................................................................ 7.8
median: ...................................................................... 7
p95: ......................................................................... 16.9
p99: ......................................................................... 22.9
http.responses: ................................................................ 200
vusers.completed: .............................................................. 10
vusers.created: ................................................................ 10
vusers.created_by_name.0: ...................................................... 10
vusers.failed: ................................................................. 0
vusers.session_length:
min: ......................................................................... 155.8
max: ......................................................................... 230.8
mean: ........................................................................ 185.7
median: ...................................................................... 175.9
p95: ......................................................................... 223.7
p99: ......................................................................... 223.7
All VUs finished. Total time: 3 seconds
--------------------------------
Summary report @ 01:58:22(+0900)
--------------------------------
http.codes.200: ................................................................ 200
http.downloaded_bytes: ......................................................... 141400
http.request_rate: ............................................................. 194/sec
http.requests: ................................................................. 200
http.response_time:
min: ......................................................................... 5
max: ......................................................................... 27
mean: ........................................................................ 7.8
median: ...................................................................... 7
p95: ......................................................................... 16.9
p99: ......................................................................... 22.9
http.responses: ................................................................ 200
vusers.completed: .............................................................. 10
vusers.created: ................................................................ 10
vusers.created_by_name.0: ...................................................... 10
vusers.failed: ................................................................. 0
vusers.session_length:
min: ......................................................................... 155.8
max: ......................................................................... 230.8
mean: ........................................................................ 185.7
median: ...................................................................... 175.9
p95: ......................................................................... 223.7
p99: ......................................................................... 223.7
http.codes.200 … 숫자
: HTTP 200 OK 응답을 받은 요청이 총 200번, 모든 요청이 성공적으로 처리되었음을 의미http.requests … 숫자
: 테스트 동안 총 200개의 HTTP 요청이 실행되었음http.responses … 숫자
: 테스트 동안 총 200개의 HTTP 응답을 받았음http.request_rate … 200/sec
: 초당 요청률이 200회 였음min
, max
, mean
, median
, p95
, p99
는 응답 시간의 통계를 의미 (모두 밀리초 단위).min: 0
는 최소 응답 시간이 0ms 였음max: 2
는 최대 응답 시간이 2ms 였음mean: 0.6
는 평균 응답 시간이 0.6ms 였음median: 1
는 중앙값 응답 시간이 1ms 였음p95: 1
, p99: 1
는 각각 95%, 99%의 요청이 1ms 이하의 응답 시간을 가졌음!