Scheduler processes one batch per worker per tick: default throughput capped at <10 msg/s, backlog grows unbounded
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 52/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Kotlin
- Sterne
- 14
- Forks
- 0
- Ø Merge
- 14 Std. 16 Min.
- Gemergte PRs (30 T.)
- 9
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus softwaremill/okapi
-
bug
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
softwaremill/okapi#141 ·
Maintainer antworten meist innerhalb von 1 Tag
-
OutboxProcessorListener events are emitted before the transaction commits; metrics over-count on commit failureEvtl. vergeben @rawo hat das vor 2 Tagen übernommen. Offenbreaking-change bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
softwaremill/okapi#137 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 4/5 1-2 Tage Anfängerfreundlichkeit 42/100
softwaremill/okapi#136 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 3/5 Ein halber Tag Anfängerfreundlichkeit 62/100
softwaremill/okapi#134 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 22/100
softwaremill/okapi#133 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in softwaremill/okapi
Ähnliche Issues
-
[Submission] 招商银行Offensubmit-adaption submit-adaption-pre
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
BetterAndroid/android-notification-icon-project#848 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
"Tick" is confusingOffenbug
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 70/100
orgzly-revived/orgzly-android-revived#1132 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
commons-app/apps-android-commons#7275 ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
liberation-data/drivine4j#682 ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
developmentwithyash/yaan#14 ·
Maintainer antworten meist innerhalb von 2 Tagen