Skip to content

fix: k6 테스트 버그 수정 및 메모리 한도 상향#128

Closed
docodocod wants to merge 1 commit into
mainfrom
feat/k6-test-fix
Closed

fix: k6 테스트 버그 수정 및 메모리 한도 상향#128
docodocod wants to merge 1 commit into
mainfrom
feat/k6-test-fix

Conversation

@docodocod

Copy link
Copy Markdown
Contributor
  • 05-store-list: DISTRICTS 한글 → 영문 enum 값으로 수정 (에러율 100% 원인)
  • 06-store-nearby: HTTP 요청에 고정 name 태그 추가 (Prometheus cardinality 폭발 방지)
  • docker-compose.prod.yml: 부하테스트 중 OOM 방지를 위한 컨테이너 메모리 한도 상향 (app 600M→1000M, prometheus 350M→800M, loki/grafana/redis/promtail/kafka 상향)

📢 기능 설명

필요시 실행결과 스크린샷 첨부

연결된 issue

연결된 issue를 자동을 닫기 위해 아래 {이슈넘버}를 입력해주세요.

close #{이슈넘버}

✅ 체크리스트

  • PR 제목 규칙 잘 지켰는가?
  • 추가/수정사항을 설명하였는가?
  • 이슈넘버를 적었는가?

- 05-store-list: DISTRICTS 한글 → 영문 enum 값으로 수정 (에러율 100% 원인)
- 06-store-nearby: HTTP 요청에 고정 name 태그 추가 (Prometheus cardinality 폭발 방지)
- docker-compose.prod.yml: 부하테스트 중 OOM 방지를 위한 컨테이너 메모리 한도 상향
  (app 600M→1000M, prometheus 350M→800M, loki/grafana/redis/promtail/kafka 상향)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@docodocod docodocod closed this Jun 2, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request increases memory limits for several services in the production Docker Compose configuration, updates district names to English in the k6 store list test, adds error logging for failed requests, and tags HTTP requests in the nearby store test. The review highlights two key issues: first, the total memory limits in docker-compose.prod.yml now exceed the 2GB capacity of a t3.small instance, risking OOM killer termination; second, the unconditional console.log on test failures in k6/05-store-list.js can cause I/O bottlenecks under high load, distorting performance metrics. It is recommended to upgrade the host instance or optimize memory limits, and to sample or conditionally toggle the error logs.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread docker-compose.prod.yml
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을 유지해야 한다면, 각 컴포넌트의 메모리 제한을 다시 최적화하고 불필요한 모니터링 컴포넌트의 리소스 할당을 줄여야 합니다.

Comment thread k6/05-store-list.js
'목록 조회 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)}\`);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant