Replies: 5 comments 3 replies
-
첫번째 시도import http from 'k6/http';
import {check, sleep } from 'k6';
export const options = {
stages: [
{ duration: "1m", target: 10 },
{ duration: "1m", target: 50 },
{ duration: "1m", target: 100 },
{ duration: "1m", target: 200 },
{ duration: "1m", target: 300 },
{ duration: "1m", target: 300 },
{ duration: "1m", target: 0},
],
};
function getPage(api) {
const response = http.get(api);
check(response, {
'response code was 200': (response) => response.status == 200,
});
sleep(4);
}
export default function () {
getPage("https://api.code-zap.com/templates?sort=modifiedAt%2Cdesc&page=1&size=20");
} |
Beta Was this translation helpful? Give feedback.
-
구경가기 첫 화면 부하 테스트VUs = 600script : import http from 'k6/http';
import {check, sleep } from 'k6';
export const options = {
stages: [
{ duration: "30s", target: 600 },
{ duration: "4m30s", target: 600 },
//{ duration: "10s", target: 300 },
//{ duration: "0s", target: 1000 },
//{ duration: "0s", target: 1500 },
//{ duration: "0s", target: 2000 },
//{ duration: "0s", target: 3000 },
//{ duration: "0s", target: 4000 },
//{ duration: "0s", target: 5000 },
//{ duration: "0s", target: 3000 },
//{ duration: "0s", target: 1000 },
//{ duration: "10s", target: 0 },
],
thresholds: {
http_req_duration: ["p(95)<10000"],
},
// systemTags: [
// 'http_req_duration'//,
// 'http_req_blocked'
// ],
};
function getPage(api) {
const response = http.get(api);
check(response, {
'response code was 200': (response) => response.status == 200,
});
sleep(4);
}
export default function () {
const url =
"https://api.code-zap.com/templates?sort=modifiedAt%2Cdesc&page=1&size=20";
// "https://api.code-zap.com/templates/1128";
getPage(url);
} |
Beta Was this translation helpful? Give feedback.
-
VUs = 800import http from 'k6/http';
import {check, sleep } from 'k6';
export const options = {
stages: [
{ duration: "30s", target: 800 },
{ duration: "4m30s", target: 800 },
],
thresholds: {
http_req_duration: ["p(95)<1000"],
},
};
function getPage(api) {
const response = http.get(api);
check(response, {
'response code was 200': (response) => response.status == 200,
});
sleep(4);
}
export default function () {
const url =
"https://api.code-zap.com/templates?sort=modifiedAt%2Cdesc&page=1&size=20";
// "https://api.code-zap.com/templates/1128";
getPage(url);
} |
Beta Was this translation helpful? Give feedback.
-
시나리오 기반 테스트7기 디스코드 전체 인원 : 2500 1. 템플릿 목록 조회 (구경가기)배경: 7기 프리코스 대상 홍보 직후 결과
|
Beta Was this translation helpful? Give feedback.
-
k6를 사용해 부하 테스트고려한 시나리오:
테스트 서버에서 진행1. 키워드 검색800명을 기준으로 진행했을 때 평균 13.35s 의 응답시간 2. 전체 플로우
값 조정을 하지 않아도 충분한 성능이라 판단. 부하가 발생하는 상황을 판단하기 위해 500명으로 늘려봄
성능 개선 과정DB 설정 변경
성능이 개선되지 않았음
✅ Tomcat Thread 변경 (200 -> 100)성능이 유의미하게 개선
둘다 적용
성능이 유의미하게 개선
운영 서버에서 테스트 결과
변경 전
변경 후
성능 개선사항이 존재하지 않음. (참고) VUs = 800 으로 늘리면
|
Beta Was this translation helpful? Give feedback.
-
K6로 부하테스트 진행해요~
Beta Was this translation helpful? Give feedback.
All reactions