-
Notifications
You must be signed in to change notification settings - Fork 1
[Refactor] API 지연 개선을 위한 인스턴스 스케일업 및 동작 방식 변경 -1 #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- 컨테이너 네트워크 모드를 host 타입으로 변경 - 에이전트 컨테이너를 루프백 주소로 변경
Walkthrough이번 변경 사항은 개발 및 운영 환경의 Terraform 인프라 구성에 집중되어 있습니다. EC2 인스턴스 타입, ECS 태스크 정의의 메모리 및 네트워크 모드, 스크립트의 디렉터리 및 권한 설정, IAM 정책 추가, 컨테이너 명령어 및 로그 경로 등이 업데이트되었습니다. 주요 리소스의 성능 및 보안 관련 설정이 조정되었습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant UserDataScript
participant OS
participant Cron
UserDataScript->>OS: /home/ec2-user/logs/backup 디렉터리 생성
UserDataScript->>OS: logs, mysql, scripts 디렉터리 권한 재설정
UserDataScript->>Cron: 크론 작업 등록 (로그를 logs/backup 하위로 리디렉션)
sequenceDiagram
participant Terraform
participant AWS IAM
participant EC2
Terraform->>AWS IAM: ec2-to-ecs 역할에 ssm_mysql_url_access 인라인 정책 추가
EC2->>AWS IAM: SSM 파라미터 dev/MYSQL_URL 접근 시도
AWS IAM-->>EC2: 접근 허용
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15–25 minutes Poem
Note 🔌 MCP (Model Context Protocol) integration is now available in Early Access!Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
📄 Terraform Plan Summary🛡️ Common InfrastructureStatus: 🔄 Changes Detected 🛠️ Development EnvironmentStatus: 🔄 Changes Detected 📋 Full Results: View in Actions |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
terraform/common/locals.tf(1 hunks)terraform/dev/locals.tf(2 hunks)terraform/dev/scripts/user-data.sh(2 hunks)terraform/dev/terraform.tfvars(3 hunks)terraform/prod/ecs/locals.tf(1 hunks)terraform/prod/locals.tf(1 hunks)terraform/prod/scripts/user-data.sh(2 hunks)terraform/prod/terraform.tfvars(1 hunks)
🔇 Additional comments (14)
terraform/prod/locals.tf (1)
53-53: 인스턴스 스케일업 변경 승인t3.micro에서 t3a.small로의 인스턴스 타입 변경이 API 응답 지연 문제 해결을 위한 PR 목표와 일치합니다. 성능 향상에 기여할 것으로 예상됩니다.
terraform/dev/locals.tf (2)
45-45: 인스턴스 스케일업 변경 승인개발 환경에서도 인스턴스 타입이 t2.micro에서 t3a.small로 변경되어 프로덕션 환경과 일관성을 유지하며 성능 향상에 기여할 것입니다.
84-84: 네트워크 모드 변경에 맞춘 적절한 Datadog 에이전트 호스트 설정Datadog 에이전트 호스트가 고정 IP에서 127.0.0.1로 변경되었습니다. 이는 ECS 태스크의 네트워크 모드가 "host"로 변경된 것과 일치하여 올바른 설정입니다.
terraform/prod/ecs/locals.tf (1)
78-91: 컨테이너 파일 경로 확인 완료: 경로 일치
- Dockerfile에서
/dd-java-agent.jar와/api.jar가 컨테이너 루트에 복사되는 것이 확인되었습니다.- Terraform의
-javaagent:/dd-java-agent.jar및-jar /api.jar명령과 완전히 일치합니다.terraform/dev/scripts/user-data.sh (2)
10-14: 디렉토리 구조 및 권한 설정 개선 승인로그 백업을 위한 중첩 디렉토리 구조 생성과 재귀적 소유권 설정이 추가되었습니다. 이는 로그 관리 개선과 적절한 파일 권한 보장에 도움이 됩니다.
32-33: 크론 작업 로그 경로 일관성 확보크론 작업의 로그 출력 경로가 새로운 backup 서브디렉토리와 일치하도록 업데이트되었습니다. 로그 관리의 일관성을 향상시킵니다.
terraform/prod/terraform.tfvars (3)
21-22: 리소스 할당 및 네트워크 모드 변경 승인API 컨테이너의 메모리가 256MB에서 1024MB로 4배 증가하고 네트워크 모드가 "host"로 변경되었습니다. 이는 API 응답 지연 해결을 위한 성능 개선 목표와 일치합니다.
30-30: 볼륨 경로 변경 확인볼륨 호스트 경로가
/home/ec2-user/api에서/home/ec2-user/logs/로 변경되었습니다. 이는 로그 중심의 디렉토리 구조로의 변경을 반영합니다.
38-40: Datadog 에이전트 리소스 및 네트워크 설정 개선Datadog 에이전트의 메모리가 128MB에서 256MB로 증가하고 네트워크 모드가 "host"로 변경되었습니다. 이는 향상된 모니터링 성능과 host 네트워킹의 이점을 활용할 수 있게 합니다.
terraform/prod/scripts/user-data.sh (2)
10-13: 프로덕션 환경 디렉토리 구조 일관성 확보개발 환경과 일치하는 로그 백업 디렉토리 구조와 재귀적 소유권 설정이 추가되었습니다. 환경 간 일관성과 적절한 권한 관리를 보장합니다.
28-28: 크론 작업 로그 경로 업데이트 승인크론 작업 로그가 새로운 backup 서브디렉토리로 리디렉션되도록 업데이트되어 로그 관리 구조가 개선되었습니다.
terraform/dev/terraform.tfvars (3)
24-25: 개발 환경 API 컨테이너 리소스 및 네트워크 설정 승인API 컨테이너의 메모리가 4배 증가(256MB → 1024MB)하고 네트워크 모드가 "host"로 변경되어 프로덕션 환경과 일관성을 유지하며 성능 개선을 달성합니다.
51-51: MySQL 컨테이너 네트워크 모드 변경 승인MySQL 컨테이너의 네트워크 모드가 "host"로 변경되어 다른 서비스들과 일관된 네트워킹 구성을 제공합니다.
92-93: Datadog 에이전트 리소스 및 네트워크 설정 개선Datadog 에이전트의 메모리가 2배 증가(128MB → 256MB)하고 네트워크 모드가 "host"로 변경되어 향상된 모니터링 성능과 호스트 네트워크 접근성을 제공합니다.
leegwichan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다! 인스턴스 증가 및 중단 배포로 전환 확인했습니다
|
🎉 This PR is included in version 1.4.0-develop.72 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.7.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |



✨ 개요
🧾 관련 이슈
#133
🔍 참고 사항 (선택)
Summary by CodeRabbit
신규 기능
버그 수정
/home/ec2-user/logs/backup으로 통일되어 권한 및 로그 관리가 개선되었습니다.기능 개선