Skip to content
Merged
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
6 changes: 6 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ services:

# 메모리 제한 설정 (서버 스펙에 맞게 조정 가능, 최소 256m~512m 추천)
KAFKA_HEAP_OPTS: "-Xms256m -Xmx256m"

# 단일 broker 운영용 internal topic 설정.
# default(3)면 __consumer_offsets/__transaction_state 가 영원히 생성 실패 → consumer group join 불가.
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
Comment on lines +208 to +210

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

현재 설정된 KAFKA_HEAP_OPTS: "-Xms256m -Xmx256m"와 같이 메모리가 매우 제한된 환경(t3.small 등)에서 단일 브로커를 운영할 때, 내부 토픽(__consumer_offsets, __transaction_state)의 기본 파티션 수(기본값 각각 50개)는 불필요하게 많은 파일 디스크립터와 메모리 오버헤드를 발생시킬 수 있습니다.

따라서 단일 브로커 환경에서는 이 내부 토픽들의 파티션 수를 1개로 줄여 리소스를 최적화하는 것을 권장합니다.

      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
      KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: 1
      KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
      KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
      KAFKA_TRANSACTION_STATE_LOG_NUM_PARTITIONS: 1

# 임시 폴더인 /tmp 대신 컨테이너가 내려가도 데이터와 오프셋 장부가 보존되도록 볼륨 볼륨 마운트 경로 고정
volumes:
- kafka-prod-data:/var/lib/kafka/data
Expand Down
Loading