Repository navigation
perf: keep ingest, rollups and compaction healthy under saturation - #313
Merged
Merged
Conversation
On an 8-vCPU host under sustained overload, compaction fell behind to about 50,000 live Parquet files and throughput dropped across repetitions. Rollup, detector and anomaly writes timed out on the analytical write gate. A local profile traced most of this to the rollups' five-minute safety lag. Every service and edge pass re-aggregated the last five minutes of ingest and held the write gate for tens of seconds. - Rollups follow an exact publication horizon. Each commit attempt gets a strictly increasing ingestion stamp, and the repository tracks attempts still in flight. Service and edge passes process disjoint windows up to the horizon. The five-minute lag and the SQL scans for the newest and oldest stamps are gone. Edge passes repair relationships whose spans arrive up to five minutes apart, and compute their affected buckets once per pass. - Error-rate, latency and volume detectors read completed service-rollup minutes instead of scanning raw spans. They persist the window they evaluated, and skip a check until a new minute completes and every query succeeds. Annotation writes that time out retry on their own. - Version history drains on its own loop with a larger per-pass budget, so its gate waits no longer delay the read cache. - Background readers do not enter the Parquet snapshot while a publication waits. Dashboard queries keep their grace period. - Ingest waits when reclaimable generation-0 compaction debt reaches 1,024 batches. From half that debt, it widens its admission window to 250 ms, and compaction takes generation-0 groups first. New metrics: fanout_compaction_backlog_batches and fanout_ingest_backpressure_seconds_total. In local end-to-end runs at a fixed mixed load, rollup lag fell from 300 s to 0 and live files stayed near 2,000. The write-gate timeouts did not recur. Claude-Session: https://claude.ai/code/session_01XA52nWyQ3R5f5kK8kjpAQW
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A benchmark of v2026.10.3-alpha on an 8-vCPU host (Fanout alone, generators on
a separate VM) exposed three problems under sustained overload:
analytical write gate.
A local profile traced most of it to the rollups' five-minute safety lag. Every
service and edge pass re-aggregated the last five minutes of ingest and held
the write gate for tens of seconds.
Rollups
Each commit attempt gets a strictly increasing ingestion stamp, and the
repository tracks attempts still in flight. Service and edge passes
process disjoint windows up to that horizon, with no SQL scan for the
newest or oldest stamp.
to five minutes apart. The affected buckets are computed once per pass in a
transaction-local temporary table.
Detectors
minutes instead of scanning 30 minutes of raw spans. Latency now uses the
rollup's served-span p95; log patterns still read logs.
minute completes and every query succeeds, and annotation writes that time
out retry on their own.
Background work
waits no longer delay the read cache.
snapshot while a publication waits. Dashboard queries keep their 30-second
grace period.
Ingest backpressure
batches.
compaction takes generation-0 groups first.
fanout_compaction_backlog_batchesandfanout_ingest_backpressure_seconds_total.No configuration, Parquet format, physical schema, or durability change.
Acknowledgement still follows durable publication.
Test plan
just checkjust test-racehttps://claude.ai/code/session_01XA52nWyQ3R5f5kK8kjpAQW