G
YouTube TikTok Games
Skip to content

feature-benchmark: add CompactionMemory scenario - #40703

Open
antiguru wants to merge 1 commit into
mh/feature-benchmark-current-sourcefrom
mh/feature-benchmark-compaction-memory
Open

antiguru wants to merge 1 commit into
mh/feature-benchmark-current-sourcefrom
mh/feature-benchmark-compaction-memory

Conversation

@antiguru

@antiguru antiguru commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Adds CompactionMemory, a ScenarioBig that measures environmentd's peak memory and compaction time while compacting table batches written by COPY INTO ... FROM S3. The data has low-cardinality text columns, which parquet dictionary-encodes, so the decoded arrow is much larger than the encoded parts the compaction memory budget counts.

The report's memory figures are taken after compaction finishes, so the scenario prints environmentd's cgroup memory.peak and compaction metrics as a COMPACTION-MEMORY log line. Run it with --other-tag=current-source to compare parameter sets on one build.

🤖 Generated with Claude Code

@antiguru
antiguru added this pull request to stack #40706 November 13, 2026 12:52
@antiguru antiguru changed the title mh/feature benchmark compaction memory feature-benchmark: add CompactionMemory scenario Nov 13, 2026
@antiguru
antiguru requested a review from def- November 13, 2026 13:02
@antiguru
antiguru marked this pull request as ready for review November 13, 2026 13:02

@def- def- left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a nit about the comment



class CompactionMemory(ScenarioBig):
"""Measure environmentd memory and time while compacting table batches written by

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't every scenario measure envd memory and time?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the first sentence said nothing specific to this scenario. The docstring now opens with the workload and the peak it reports, and says why the standard memory figure misses that peak.

Posted by Claude Code.

@def-

def- commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

QA LLM Review

1. MEDIUM -- The idle check counts applied chunks as completed requests

misc/python/materialize/feature_benchmark/scenarios/benchmark_main.py:544

The idle check can report zero while incremental compaction is still processing additional chunks. This lets the benchmark finish successfully before the measured work completes, understating its duration and potentially missing its memory peak or carrying compaction work into the next iteration.

Details

started increments once per request (src/persist-client/src/internal/compact.rs:327), but the incremental loop calls apply for each chunk (src/persist-client/src/internal/compact.rs:425), incrementing applied or noop each time (src/persist-client/src/internal/compact.rs:535). Incremental compaction is enabled by default. With requested=started=applied=1, this helper returns zero even while the second chunk runs. Five polls do not fix that accounting error. Extra applications from earlier iterations also mask newly started requests because these counters are cumulative.

The queue calculation separately subtracts skipped, although skipped requests return before incrementing requested (src/persist-client/src/internal/compact.rs:294), hiding queued work too. Use a completion signal or gauge that tracks whole requests through their actual completion, and exclude skipped from the queue balance.

Measures environmentd's peak memory and compaction time while compacting
table batches that COPY INTO writes from S3. The data has low-cardinality
text columns, which parquet dictionary-encodes, so decoded arrow is much
larger than the encoded parts that the compaction memory budget counts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@antiguru
antiguru force-pushed the mh/feature-benchmark-compaction-memory branch from 7b6c8a9 to 84d8bbf Compare November 13, 2026 19:25

This branch has not been deployed

No deployments
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.

2 participants