Skip to content

[Perf] 자동 Worker 전체 문서 인덱싱 처리량 Benchmark 추가 - #135

Merged
Gimini-3 merged 6 commits into
developfrom
feature/133
Aug 9, 2026
Merged

[Perf] 자동 Worker 전체 문서 인덱싱 처리량 Benchmark 추가#135
Gimini-3 merged 6 commits into
developfrom
feature/133

Conversation

@Gimini-3

@Gimini-3 Gimini-3 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

🔍️ 작업 내용

  • 실제 PostgreSQL 17.8, pgvector 0.8.1, MinIO, BAAI/bge-m3를 연결한 자동 Worker 전체 인덱싱 처리량 Benchmark 추가
  • 일반 테스트와 분리된 workerIndexingThroughputTest Gradle 실행 경계 추가
  • CPU 추론 환경을 위한 Embedding 연결·응답 Timeout 구성 분리(기본값 5초 유지)
  • 16개·32개 문서 각 3회 실측 결과와 데이터 완전성 검증 문서 추가

Closes #133

✨ 상세 설명

  • 업로드 → MinIO → PENDING → 자동 Claim → Parsing/Chunk → BGE-M3 Batch → vector(1024) 저장 → INDEXED/current_version 전환 전체 경로를 측정합니다.
  • 16문서 중앙값: 50.255초, 분당 19.102문서, 초당 2.547 Chunk/Embedding
  • 32문서 중앙값: 104.335초, 분당 18.402문서, 초당 2.454 Chunk/Embedding
  • 여섯 실행 모두 Chunk 수와 Embedding 수가 일치하고 1024차원 Vector·상태 전이 불변식을 만족했습니다.

✅ 검증

  • ./gradlew test --tests 'com.opensource.docgrid.e2e.WorkerIndexingThroughputStatisticsTest'
  • 4문서 실제 BGE-M3 Smoke: PASS
  • DB_SSLMODE=disable ./gradlew workerIndexingThroughputTest: PASS (8분 1초)
  • 전체 Java 회귀: PASS (720 tests, failure/error/skipped 0)
  • git diff --check: PASS

🛠️ 추후 리팩토링 및 고도화 계획

  • Worker 수·동시 실행 슬롯별 수평 확장 비교
  • Queue 적체·Backpressure 및 장애 주입 Profile
  • 공식 OpenSQL 원격 환경에서 동일 Benchmark 재검증

💬 리뷰 요구사항

  • Benchmark 전용 Schema·Bucket 정리 경계와 결과 불변식
  • 운영 기본 Timeout을 유지하면서 Benchmark만 응답 제한을 확장한 설정 경계
  • Local CPU 기준선이라는 결과 해석 범위

Summary by CodeRabbit

  • 새로운 기능

    • 임베딩 서버의 연결 및 응답 제한 시간을 환경 변수로 설정할 수 있습니다.
    • 기본 제한 시간은 각각 5초이며, 운영 환경에 맞게 조정할 수 있습니다.
  • 성능 및 검증

    • Worker의 전체 문서 인덱싱 처리량을 측정하는 전용 벤치마크를 추가했습니다.
    • 문서 처리량, 지연 시간, 큐 처리 및 인덱싱 결과 정합성을 검증하고 결과를 JSON과 문서로 보존합니다.
  • 문서

    • 벤치마크 실행 방법, 측정 결과, 환경 정보 및 한계를 문서화했습니다.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Gimini-3, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: cc457d3a-534b-4775-985c-0c6bb6ae7866

📥 Commits

Reviewing files that changed from the base of the PR and between c6d91cc and 2d29aac.

📒 Files selected for processing (1)
  • src/test/java/com/opensource/docgrid/e2e/WorkerIndexingThroughputBenchmark.java
📝 Walkthrough

Walkthrough

실제 PostgreSQL, pgvector, MinIO, BGE-M3를 사용하는 Worker 인덱싱 처리량 Benchmark를 추가했다. 전용 Gradle Task, timeout 설정, percentile 계산, 상태 정합성 검증, JSON 결과 기록과 실측 문서를 포함한다.

Changes

Worker 인덱싱 처리량

Layer / File(s) Summary
Benchmark 계약과 측정 지표
docs/design/...worker-indexing-throughput-benchmark.md
결정적 TXT Workload와 측정 Profile을 정의했다. 처리량, 지연시간, 환경 지문, Job·Attempt·Event·Version·Vector 정합성 규칙을 명시했다.
전용 실행 경계와 완료 정책
build.gradle, docs/design/...worker-indexing-throughput-benchmark.md
workerIndexingThroughputTest Task와 전용 JUnit 태그를 추가했다. 시스템 속성, 기본 JSON 경로, 비캐시 실행, timeout 및 결과 보존 정책을 설정했다.
Benchmark 실행과 통계 검증
src/test/java/com/opensource/docgrid/e2e/WorkerIndexingThroughputBenchmark.java, src/test/java/com/opensource/docgrid/e2e/WorkerIndexingThroughputStatistics.java, src/test/java/com/opensource/docgrid/e2e/WorkerIndexingThroughputStatisticsTest.java, src/test/java/com/opensource/docgrid/e2e/LocalE2eMinioBucket.java
실제 인프라에 문서를 병렬 업로드하고 Worker 완료를 대기한다. 인덱싱 상태와 Chunk·Embedding·Vector 정합성을 검증한다. 처리량과 percentile 통계를 계산하고 JSON 결과를 저장한다.
Embedding timeout 설정
src/main/java/.../EmbeddingServerConfig.java, src/main/resources/application.yml
Embedding Provider의 연결 및 읽기 timeout을 설정 가능한 Duration 값으로 변경했다. 기본값은 각각 5초다.
실측 결과와 검증 기록
docs/test-results/...worker-indexing-throughput-benchmark.md
16개·32개 문서 Profile의 처리량, 지연시간, 완전성 검증, 실행 절차, 회귀 테스트 결과와 측정 한계를 기록했다.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Benchmark as WorkerIndexingThroughputBenchmark
  participant API as HTTP API
  participant Worker
  participant Storage as MinIO
  participant DB as PostgreSQL
  participant Embedding as BGE-M3

  Benchmark->>API: TXT 문서 병렬 업로드
  API->>Storage: Object 저장
  API->>DB: 인덱싱 Job 생성
  Worker->>DB: Job Claim 및 상태 갱신
  Worker->>Storage: 문서 조회
  Worker->>Embedding: Chunk Embedding 요청
  Worker->>DB: Chunk, Embedding, Vector 저장
  Benchmark->>DB: INDEXED 및 정합성 검증
  Benchmark->>Benchmark: 처리량·지연시간 계산 및 JSON 저장
Loading

Possibly related PRs

  • DocGrid/backend#45: 동일한 EmbeddingServerConfig의 Embedding 서버 timeout 설정과 직접 연결된다.
  • DocGrid/backend#49: Benchmark가 사용하는 Embedding Job claim 및 lease 흐름과 연결된다.
  • DocGrid/backend#102: Benchmark가 검증하는 BGE-M3 batch embedding 경로와 연결된다.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목은 자동 Worker 전체 문서 인덱싱 처리량 Benchmark 추가라는 PR의 핵심 변경을 명확하고 간결하게 설명합니다.
Description check ✅ Passed 필수 작업 내용, 상세 설명, 검증 결과, 후속 계획, 리뷰 요구사항을 포함하며 선택 항목인 스크린샷은 생략되었습니다.
Linked Issues check ✅ Passed 전용 Gradle Task, 실환경 Benchmark, 처리량·지연 측정, 정합성 검증, 결과 기록 등 Issue #133의 요구사항을 충족합니다.
Out of Scope Changes check ✅ Passed 변경 사항은 Issue #133의 Benchmark 구현, 결과 문서화, CPU 환경용 Timeout 설정 범위에 포함됩니다.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/133

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/test/java/com/opensource/docgrid/e2e/WorkerIndexingThroughputBenchmark.java`:
- Around line 71-73: Update the TEST_SCHEMA constant used by
measureAutomaticWorkerIndexingThroughput() to include a per-execution UUID,
matching the isolation approach already used by TEST_BUCKET. Preserve the
existing schema prefix while ensuring concurrent Gradle processes never share
the same schema.
- Around line 425-429: Update assertProfileInvariants() to explicitly verify
that workerLifecycleManager.getWorkerId().isPresent() is true alongside the
existing queue and chunk assertions, ensuring the Worker remains registered when
the Profile completes; alternatively remove any result-document claim that this
check validates Worker liveness.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1ba51124-7ba9-4d38-97fb-e452f0c4dc7e

📥 Commits

Reviewing files that changed from the base of the PR and between 2809282 and c6d91cc.

📒 Files selected for processing (9)
  • build.gradle
  • docs/design/gimin-#133-worker-indexing-throughput-benchmark.md
  • docs/test-results/gimin-#133-worker-indexing-throughput-benchmark.md
  • src/main/java/com/opensource/docgrid/global/config/EmbeddingServerConfig.java
  • src/main/resources/application.yml
  • src/test/java/com/opensource/docgrid/e2e/LocalE2eMinioBucket.java
  • src/test/java/com/opensource/docgrid/e2e/WorkerIndexingThroughputBenchmark.java
  • src/test/java/com/opensource/docgrid/e2e/WorkerIndexingThroughputStatistics.java
  • src/test/java/com/opensource/docgrid/e2e/WorkerIndexingThroughputStatisticsTest.java

Comment thread src/test/java/com/opensource/docgrid/e2e/WorkerIndexingThroughputBenchmark.java Outdated
@Gimini-3
Gimini-3 merged commit 1ea8376 into develop Aug 9, 2026
1 check passed
@Gimini-3 Gimini-3 self-assigned this Aug 10, 2026
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.

자동 Worker 전체 문서 인덱싱 처리량 Benchmark 추가

1 participant