커밋 그래프

164 커밋

작성자 SHA1 메시지 날짜
dc586dde0c docs: Phase 5~6 구현 진행 문서 및 성능 보고서 업데이트
- implementation-progress.md: Phase 5~6 체크리스트 추가 (전항목 완료)
- websocket-performance-improvement-report.md: 대기열 구조, 캐시 아키텍처 설명 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 15:34:32 +09:00
03b14e687a feat: 일일 데이터 인메모리 캐시 구현 (Phase 6)
- DailyTrackCacheManager: D-1~D-7 daily 테이블 데이터 인메모리 캐시
  - @Async 비동기 워밍업 (서버 시작 차단 없음, 최근 우선 로드)
  - 뷰포트 필터링, 다중 날짜 병합 조회, 하이브리드 쿼리 분리
  - 메모리 한도 체크 (기본 5GB), 날짜별 즉시 활성화
- DailyTrackCacheProperties: enabled, retentionDays, maxMemoryGb 설정
- DailyAggregationJobConfig: 배치 완료 시 캐시 자동 갱신 리스너
- ChunkedTrackStreamingService: daily 전략에서 캐시 우선 조회 + DB 폴백
- StompTrackStreamingService: 동일 캐시 우선 패턴 적용
- WebSocketMonitoringController: GET /api/websocket/daily-cache 엔드포인트
- application-prod.yml: cache.daily-track 설정 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 15:34:20 +09:00
7bd7bf556e feat: 대기열 기반 쿼리 관리 및 타임아웃 최적화 (Phase 5)
- 거부 대신 대기열 순번 안내: QUEUED 상태 2초 간격 전송 (최대 2분)
- QueryStatusUpdate에 queuePosition, totalInQueue 필드 추가
- ActiveQueryManager: ConcurrentLinkedQueue 기반 대기열 추적
- WebSocketProperties에 SessionProperties 추가 (타임아웃/하트비트 설정)
- WebSocketStompConfig: 하드코딩 → Properties 주입으로 전환
- application-prod.yml: Query풀 180, global 60, idle 15s, heartbeat 5s
- AsyncConfig: core 40, max 120, queue 100 (대기열 수용)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 15:34:02 +09:00
60366816a6 docs: 구현 진행 문서 최종 업데이트 - 전 단계 완료
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 13:46:06 +09:00
c92bf0e5ad feat: WebSocket 설정 외부화 및 부하 제어 모니터링 엔드포인트 추가
Phase 4: 설정 외부화 및 모니터링
- WebSocketProperties: websocket.* 설정을 @ConfigurationProperties로 바인딩
  - query: 동시 제한, 세션 제한, 대기 큐 타임아웃
  - transport: 인바운드/아웃바운드 채널 스레드풀, 메시지 크기
  - backpressure: 버퍼 크기, 메시지 크기 제한
- WebSocketMonitoringController에 /api/websocket/load-control 엔드포인트 추가
  - 글로벌 동시 쿼리 수, 대기 큐 현황
  - 활성 쿼리 상세 (세션ID, 쿼리ID, 시작시간, 진행테이블, 청크수, 취소여부)
  - 메모리 사용률

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 13:45:41 +09:00
7b7e283ea4 perf: 백프레셔 메커니즘 고도화 - 정확한 버퍼 추적 및 적응형 지연
Phase 3: 백프레셔 고도화
- ChunkedTrackStreamingService:
  - CompletableFuture+Thread.sleep(100ms) 추정 방식 제거
  - 전송 완료 후 try-finally에서 즉시 버퍼 크기 감소 (정확한 추적)
  - 정적 대기 → 버퍼 사용률(%) 기반 4단계 적응형 지연
- StompTrackStreamingService:
  - 총 트랙 수 기반 정적 지연 제거
  - BlockingQueue 사용률 + 데이터 크기 복합 적응형 지연으로 교체

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 13:43:50 +09:00
28908e1a0d refactor: 쿼리 생명주기 관리를 서비스 finally 블록으로 단일화
Phase 2.2: 쿼리 관리 시스템 통합
- StompTrackController의 status callback에서 activeQueryManager.completeQuery() 제거
- 리소스 정리를 서비스(ChunkedTrack/StompTrack) finally 블록에서 일괄 처리
- 중복 completeQuery 호출 제거로 쿼리 생명주기 관리 단일화

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 13:42:05 +09:00
e073007dc2 feat: ChunkedTrackStreamingService 쿼리 취소 로직 구현
Phase 2.1: 기존 TODO만 있던 cancelQuery()에 실제 취소 메커니즘 추가
- 쿼리별 AtomicBoolean 취소 플래그(queryCancelFlags) 관리
- streamChunkedTracks 시작 시 취소 플래그 등록, finally에서 정리
- 테이블 전략별 루프 진입 전 취소 확인
- isQueryCancelled()에 queryCancelFlags 통합 확인 추가
- cancelQuery() 호출 시 플래그 설정으로 진행 중인 스트리밍 중단

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 13:40:55 +09:00
122a247faf perf: DB 커넥션 풀 재분배 (총 250개, prod 환경)
Phase 1.4: DB 서버 500개 중 250개를 보수적으로 할당
- Query: 60 → 120 (min 20) — WebSocket 스트리밍 + REST API 주 사용 (48%)
- Collect: 20 → 80 (min 15) — 배치 Reader, 신호 수집 조회 (32%)
- Batch: 20 → 30 (min 5) — Spring Batch 메타데이터 (12%)
- 예비: 20개 (8%) — 운영 여유분

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 13:38:15 +09:00
21916716bf fix: CancellableQueryManager의 CachedThreadPool을 제한된 ThreadPoolExecutor로 교체
Phase 1.3: 무제한 스레드 생성 방지
- newCachedThreadPool → ThreadPoolExecutor(core:5, max:20, queue:100)
- CallerRunsPolicy 적용으로 큐 포화 시 자연 백프레셔
- 부하 시 무제한 스레드 생성으로 인한 OOM/컨텍스트 스위칭 오버헤드 방지

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 13:37:17 +09:00
78ff307785 feat: 글로벌 동시 쿼리 제한(Semaphore) 및 쿼리 완료 시 리소스 반환 보장
Phase 1.1 + 1.2: WebSocket 리플레이 요청 동시 부하 제어
- ActiveQueryManager에 Fair Semaphore 기반 글로벌 동시 쿼리 제한 추가 (기본 30개)
- @Async 스트리밍 메서드 내에서 슬롯 획득 (인바운드 채널 블로킹 방지)
- 쿼리 완료/실패/취소 시 finally 블록에서 반드시 리소스 반환
  - 글로벌 Semaphore 슬롯 반환
  - 세션별 쿼리 카운트 감소 (기존 누락 수정)
  - ActiveQueryManager 쿼리 정리
- TrackQueryInterceptor 세션 제한값 외부 설정화 (@Value)
- application-prod.yml에 websocket.query 설정 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 13:36:10 +09:00
cc165fc36a feat: 항적 조회 안정성 개선 - 계층적 폴백, 선박 누락 방지, 2-pass 뷰포트 필터링
- GisService: 하위 구간 미집계 감지 시 상위 테이블에서 보완 집계하는
  계층적 폴백 로직 추가 (daily→hourly→5min)
- ChunkedTrackStreamingService: 빈 LineString으로 인한 선박 객체 누락 방지,
  MAX_TRACKS_PER_CHUNK를 500,000으로 증가
- ChunkedTrackStreamingService: 2-pass 뷰포트 필터링 구현
  Pass 1에서 뷰포트 교차 선박 ID를 수집하고, Pass 2에서 해당 선박의
  전체 항적을 viewport 필터 없이 조회하여 선박 소실 현상 해결
- TrackConverter: 빈 geometry에서도 선박 객체 반환하도록 수정

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 06:53:47 +09:00
89482d854f feat: Add V2 REST API with WebSocket-compatible responses
- Add GisControllerV2/GisServiceV2 for CompactVesselTrack responses
- Add nationalCode and shipKindCode fields to REST API responses
- Add flexible DateTime parsing support (multiple formats)
- Add TrackConverter utility for track data conversion
- Update SwaggerConfig with V2 API endpoints and unified tags
- Update ProdDataSourceConfig for prod-mpr profile support
- Enhance Swagger documentation for all DTOs
2026-01-20 13:38:31 +09:00
2a708b3318 Initial commit 2025-11-19 16:03:16 +09:00