Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
deploy:
resources:
limits:
memory: 600M
memory: 1000M

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

현재 docker-compose.prod.yml에 설정된 모든 서비스의 메모리 제한(Limit) 합계가 약 3.48GB(app 1000M, prometheus 800M, kafka 600M, loki 300M 등)로 크게 증가했습니다.

기존 10라인 주석에 언급된 t3.small 인스턴스는 물리 메모리가 2GB에 불과하므로, 이 설정을 그대로 적용하면 물리 메모리 고갈로 인해 호스트 OS의 OOM Killer가 작동하여 컨테이너가 강제 종료될 위험이 매우 높습니다.

권장 사항:

  1. 운영 환경의 인스턴스 스펙을 t3.medium(4GB RAM) 이상으로 상향 조정하는 것을 검토해 주세요.
  2. 만약 t3.small을 유지해야 한다면, 각 컴포넌트의 메모리 제한을 다시 최적화하고 불필요한 모니터링 컴포넌트의 리소스 할당을 줄여야 합니다.

reservations:
memory: 400M
healthcheck:
Expand Down Expand Up @@ -85,7 +85,7 @@ services:
deploy:
resources:
limits:
memory: 350M
memory: 800M
restart: unless-stopped
networks:
- catchtable-net
Expand All @@ -102,7 +102,7 @@ services:
deploy:
resources:
limits:
memory: 200M
memory: 300M
restart: unless-stopped
networks:
- catchtable-net
Expand All @@ -121,7 +121,7 @@ services:
deploy:
resources:
limits:
memory: 100M
memory: 200M
restart: unless-stopped
networks:
- catchtable-net
Expand All @@ -144,7 +144,7 @@ services:
deploy:
resources:
limits:
memory: 200M
memory: 300M
restart: unless-stopped
networks:
- catchtable-net
Expand All @@ -171,7 +171,7 @@ services:
deploy:
resources:
limits:
memory: 100M
memory: 200M
restart: unless-stopped
networks:
- catchtable-net
Expand Down Expand Up @@ -216,7 +216,7 @@ services:
deploy:
resources:
limits:
memory: 400M
memory: 600M

restart: unless-stopped
networks:
Expand Down
3 changes: 2 additions & 1 deletion k6/05-store-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const options = {
};

const CATEGORIES = ['KOREAN', 'JAPANESE', 'CHINESE', 'WESTERN', 'CAFE'];
const DISTRICTS = ['강남구', '마포구', '종로구', '용산구', '성동구'];
const DISTRICTS = ['GANGNAM', 'MAPO', 'JONGNO', 'YONGSAN', 'SEONGDONG'];

export default function () {
const isSpike = exec.scenario.name === 'event_spike';
Expand All @@ -87,6 +87,7 @@ export default function () {
'목록 조회 200': (r) => r.status === 200,
'응답 body 존재': (r) => r.body && r.body.length > 0,
});
if (!ok) console.log(`[ERROR] status=${res.status} url=${url} body=${res.body?.substring(0, 200)}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

부하 테스트(k6) 실행 중 에러가 발생할 때마다 console.log를 통해 에러 로그를 출력하도록 설정되어 있습니다.

고부하(High Load) 상황이나 일시적인 장애로 인해 에러율이 높아질 경우, 매 요청마다 발생하는 콘솔 I/O가 k6 실행 엔진의 병목 지점이 되어 CPU 사용량을 급증시키고 실제 응답 시간(Latency) 측정 결과를 왜곡할 수 있습니다.

개선 제안:
에러 로그 출력을 샘플링하여 일부 에러만 기록하거나, 디버깅 시에만 활성화할 수 있도록 환경 변수 등으로 제어하는 것을 권장합니다.

    if (!ok && Math.random() < 0.1) console.log(\`[ERROR] (Sampled 10%) status=\${res.status} url=\${url} body=\${res.body?.substring(0, 200)}\`);

errorRate.add(!ok);
});

Expand Down
4 changes: 2 additions & 2 deletions k6/06-store-nearby.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default function () {
group(`근처 매장 조회 (nearby) - ${loc.name}`, () => {
const res = http.get(
`${BASE_URL}/api/v1/stores/nearby?latitude=${lat}&longitude=${lng}&page=0&size=10`,
{ headers: HEADERS_JSON, timeout: '15s' },
{ headers: HEADERS_JSON, timeout: '15s', tags: { name: 'GET_nearby' } },
);
nearbyDuration.add(res.timings.duration);
record(res.timings.duration);
Expand All @@ -104,7 +104,7 @@ export default function () {
`?minLat=${loc.minLat}&maxLat=${loc.maxLat}` +
`&minLng=${loc.minLng}&maxLng=${loc.maxLng}` +
`&centerLat=${lat}&centerLng=${lng}&limit=50`;
const res = http.get(url, { headers: HEADERS_JSON, timeout: '15s' });
const res = http.get(url, { headers: HEADERS_JSON, timeout: '15s', tags: { name: 'GET_in_bounds' } });
inBoundsDuration.add(res.timings.duration);
record(res.timings.duration);
if (res.timings.duration >= 15000 || res.status === 0) timeoutCount.add(1);
Expand Down
Loading