fix: k6 테스트 버그 수정 및 메모리 한도 상향#129
Conversation
- 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>
There was a problem hiding this comment.
Code Review
This pull request increases memory limits for multiple services in docker-compose.prod.yml, updates district names to English, adds error logging in k6/05-store-list.js, and introduces tags for HTTP requests in k6/06-store-nearby.js. The review feedback highlights that the total memory limit now exceeds the capacity of a t3.small instance, which could lead to OOM issues, and suggests updating the corresponding comments. Additionally, it recommends using probabilistic sampling for the newly added error logging in k6 to prevent performance degradation under high load.
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.
| resources: | ||
| limits: | ||
| memory: 600M | ||
| memory: 1000M |
There was a problem hiding this comment.
현재 app 서비스의 메모리 제한을 1000M으로 상향하셨습니다. 하지만 10라인의 주석(# t3.small 메모리 한도 고려한 app 한도...)은 여전히 600M으로 기재되어 있어 실제 설정값과 일치하지 않습니다.
또한, 이 파일에 정의된 모든 서비스의 메모리 제한 합계(App 1000M, Prometheus 800M, Kafka 600M, Grafana 300M, Loki 300M, Redis 200M, Promtail 200M 등)가 약 3.48GB에 달합니다. 만약 실제 배포 환경이 주석에 언급된 t3.small (메모리 2GB) 인스턴스라면, 부하 테스트 진행 시 물리 메모리 부족으로 인해 호스트 OS 레벨에서 OOM Killer가 작동하여 컨테이너나 도커 데몬이 강제 종료될 위험이 매우 높습니다.
권장사항:
- 주석의 메모리 표기를 실제 설정값에 맞게 업데이트해 주세요.
t3.small환경을 유지해야 한다면 전체 서비스의 메모리 제한 합계를 2GB 이하로 조정하거나, 부하 테스트를 원활히 수행하기 위해 인스턴스 스펙을 최소t3.medium(4GB) 이상으로 업그레이드하는 것을 검토해 주세요.
| '목록 조회 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)}`); |
There was a problem hiding this comment.
부하 테스트 중 에러가 발생할 때 모든 실패 요청에 대해 console.log를 출력하도록 설정되어 있습니다.
고부하(High Load) 상황에서 수많은 요청이 실패할 경우, 매 요청마다 콘솔 로그를 출력하는 작업은 k6 실행 엔진의 성능을 심각하게 저하시키고 응답 시간(Response Time) 메트릭을 왜곡시킬 수 있습니다. 또한 디스크 I/O 부하 및 로그 파일 크기 폭발을 유발할 수 있습니다.
권장사항:
디버깅을 위해 로그가 필요하다면, 전체 실패에 대해 로그를 남기기보다 확률적 샘플링(예: 5% 확률)을 적용하여 로그 출력을 제한하는 것이 좋습니다.
| if (!ok) console.log(`[ERROR] status=${res.status} url=${url} body=${res.body?.substring(0, 200)}`); | |
| if (!ok && Math.random() < 0.05) console.log("[ERROR] status=" + res.status + " url=" + url + " body=" + (res.body ? res.body.substring(0, 200) : "")); |
📢 기능 설명
필요시 실행결과 스크린샷 첨부
연결된 issue
연결된 issue를 자동을 닫기 위해 아래 {이슈넘버}를 입력해주세요.
close #{이슈넘버}
✅ 체크리스트