Skip to content

[23기_김태익] 부하테스트 & 모니터링 미션 제출합니다.#54

Merged
Hoyoung027 merged 18 commits into
CEOS-Developers:taeik21from
taeik21:taeik21
May 12, 2026
Merged

[23기_김태익] 부하테스트 & 모니터링 미션 제출합니다.#54
Hoyoung027 merged 18 commits into
CEOS-Developers:taeik21from
taeik21:taeik21

Conversation

@taeik21

@taeik21 taeik21 commented May 9, 2026

Copy link
Copy Markdown

No description provided.

@Jong0128 Jong0128 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

코드 리뷰 완료했습니다!
과제 하느라 수고 많으셨습니다!!

Comment thread README.md Outdated
├── config.alloy
└── positions/
```
CICD 과정 중 배포에서 실패하여 테스트 수행하지 못했습니다.. 스터디 전까지 원인 파악하겠습니다 죄송합니다

@Jong0128 Jong0128 May 10, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

EC2에 들어가서 다음과 같이 작성해서 알아보면 좋을 거 같아요!!

sudo docker logs test           # 앱 부팅 예외 스택 확인
sudo docker ps -a               # test 컨테이너 재시작 루프 여부
curl -v http://localhost/actuator/health   # 503인지 connection refused인지
  • connection refused → 앱이 부팅 단계에서 죽음 (DB/Redis 연결 실패 가능성 큼)
  • 503 DOWN → 앱은 떴지만 Redis/DB health indicator가 실패
  • 200 UP → 헬스체크 타이밍/네트워크 이슈

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

오 배포 성공하신거같은데요??!!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

네 성공했습니다 ㅜㅜ 자세하게 알려주셔서 감사합니다!!

Comment thread README.md

- **언제**
- 서비스 규모가 너무 커져서 **Prometheus만으로는 메트릭 저장이 감당 안 될 때** (Mimir 도입)
- MSA에서 수백 개의 **요청 흐름(Tracing)을 추적**해야 할 때 (Tempo 도입)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

너무 자세하게 작성해주셔서 모르던 부분 잘 알 수 있었습니다!! 감사합니다 👍

web:
base-path: /actuator
exposure:
include: health, info, prometheus

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

물론 지금 상태도 괜찮지만, 이중 방어책으로
exclude: env, heapdump, threaddump, configprops, quartz
도 추가하면 좋을꺼같아요!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Actuator의 include 설정을 하면 나머지 모든 엔드 포인트는 모두 자동 exclude 처리가 돼서 적지 않았는데,
향후 운영 안정성을 위해서라도 명시적으로 exclude 하는게 좋을 것 같네요!! 감사합니다~!

taeik21 and others added 11 commits May 10, 2026 15:36
- Change ddl-auto from create to none to preserve production data across deployments
- Add docker login step to EC2 deploy script for private registry access

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Change Alloy scrape target from app:8080 to localhost:80 (host-exposed port)
- Mount /home/ubuntu/logs:/logs volume so Alloy can read app logs from host

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Include alloy service in CD-generated docker-compose.yml
- Write alloy/config.alloy to EC2 host via SSH script on each deploy
- Revert scrape target to app:8080 (correct for same Docker network)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…craping

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- MasterDataInitializer: STANDARD seat template A~T x 20 (400 seats total)
  ECONOMY rows A~E (100 seats, IDs 1~100), VIP rows F~T (300 seats)
- k6/payment_load_test.js: target Schedule 1 with ECONOMY seat IDs 1~100
  auto-generates 100-seat array from MasterDataInitializer data if env not set

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
/api/reservations/instant looks up reservation by paymentId, not creates one.
Step 1: POST /api/reservations/seats → get server-generated paymentId
Step 2: POST /api/reservations/instant → confirm payment with that paymentId
Also fix seat assignment: each VU uses fixed seat (VU-1 % len) to avoid contention

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Class-level @transactional(readOnly=true) caused Hibernate to set FlushMode.MANUAL,
preventing reservation.cancel() and reservation.completePayment() from being flushed
to the DB when called via self-invocation. Method-level @transactional overrides the
class-level readOnly, restoring FlushMode.AUTO so writes are committed correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tion

- cancelReservation: @transactional → REQUIRES_NEW so it commits even when the
  caller's transaction rolls back (e.g. external payment API failure)
- requestInstantPayment error paths: self.cancelReservation() via proxy to
  respect REQUIRES_NEW (self-invocation bypasses AOP proxy)
- cancelPayment: skip paymentService.cancelPayment for PENDING reservations
  (payment was never processed, so external cancel API call is unnecessary)
- Add @lazy self-injection to enable proxy-based self-calls

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@shinae1023 shinae1023 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

코드 리뷰 완료했습니다
리드미에 모니터링 관련 내용들 상세하게 적어주셔서 보면서 도움이 많이 됐어요
과제 수고하셔습니다 👍🏻

Comment thread README.md

---

### 실패의 원인

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

k6 부하 테스트 실패 원인을 단순히 표면적인 에러율로 넘기지 않고, 연쇄 작용(0.6%의 cancel 실패가 좌석을 영구적으로 잠가 42%의 reserve 실패를 유발함)을 파악하신 점이 인상 깊었습니다!
여러 방면으로 원인을 분석하고 결과를 도출해 내려고 하신 거 같아 저도 보면서 많은 도움이 되었습니다

Comment thread README.md
-> Http Response Time에서 좌석 선점을 위한 POST 요청 시간 2.91s
```
- 다른 지표들로 보아, 극단적인 1건의 지표임을 파악 가능
- DB 커넥션 풀을 디폴트 10개에서 증가시켜야함!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

application.yml의 maximum-pool-size 등을 실제로 조정한 후, 동일한 부하 테스트 시나리오를 다시 실행하여 병목이 완전히 해소되었음을 수치적으로 나타낸다면 더 좋을 거 같아요!

@Hoyoung027 Hoyoung027 merged commit 13e5b49 into CEOS-Developers:taeik21 May 12, 2026
1 check passed
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.

4 participants