Scheduler processes one batch per worker per tick: default throughput capped at <10 msg/s, backlog grows unbounded
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 52/100
Hướng nghiên cứu
Start in the OutboxScheduler in okapi-core, where scheduleWithFixedDelay runs processNext(batchSize) once per worker per tick, and read processBatch to see how each tick's transaction is opened. Change it so the loop keeps draining while a batch comes back full, with one transaction per iteration and a time or iteration budget that still lets stop() return promptly. Done means a sustained high publish rate no longer backs up the queue under default settings, stop() stays responsive, and the existing tests pass; the issue also asks for a benchmark of sustained throughput.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Severity: High (performance / unbounded backlog) · Area: okapi-core OutboxScheduler · Found in: code review of main @ e5630a1
Problem
Each scheduler tick has every worker call processNext(batchSize) exactly once, using scheduleWithFixedDelay. That puts a hard ceiling on throughput:
max throughput ≈ concurrency × batchSize / (interval + batch processing time)
With the defaults (concurrency = 1, batchSize = 10, interval = 1s) that is under 10 messages/second, regardless of how fast the DB and transport are. Any sustained publish rate above that grows the backlog without bound, and latency grows linearly with it. A burst of 100k messages takes about 3 hours to drain with the defaults, even when each batch takes milliseconds.
Raising interval to cut idle polling makes this worse. Raising batchSize makes transactions longer (see the related issues on gap locks and delivery inside the transaction).
Suggested fix
In processBatch, keep draining while the previous batch was full. Each iteration gets its own transaction, and the loop is bounded by a time or iteration budget so stop() stays responsive:
do {
val n = transactionRunner.runInTransaction { outboxProcessor.processNext(config.batchSize) }
} while (n == config.batchSize && running.get() && !budgetExceeded())
That way the poll interval only governs idle latency, not peak throughput. The benchmarks should cover a sustained-rate scenario as well as fixed-backlog drains.
- Ngôn ngữ chính
- Kotlin
- Star
- 14
- Fork
- 0
- Merge trung bình
- 14 giờ 16 phút
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của softwaremill/okapi
-
bug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
softwaremill/okapi#141 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
OutboxProcessorListener events are emitted before the transaction commits; metrics over-count on commit failureCó thể đã có người làm @rawo đã nhận 2 ngày trước. Đang mởbreaking-change bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
softwaremill/okapi#137 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 42/100
softwaremill/okapi#136 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 62/100
softwaremill/okapi#134 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 22/100
softwaremill/okapi#133 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của softwaremill/okapi
Issue tương tự
-
[Submission] 招商银行Đang mởsubmit-adaption submit-adaption-pre
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
BetterAndroid/android-notification-icon-project#848 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
"Tick" is confusingĐang mởbug
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 70/100
orgzly-revived/orgzly-android-revived#1132 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
commons-app/apps-android-commons#7275 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
liberation-data/drivine4j#682 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
developmentwithyash/yaan#14 ·
Maintainer thường phản hồi trong vòng 2 ngày