schedstat: add comprehensive GC analysis from range events#5
Merged
Conversation
Add a gc_ranges table and gc_cycles view to the schema, and handle EventRangeBegin/Active/End trace events to populate them. This captures structured GC data (mark phases, mark assist, sweeps, STW pauses) instead of relying on crude pattern-matching on g_transitions reason strings. Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
Replace the crude pattern-matching GC analysis with structured output using the gc_ranges table: cycle summary, STW breakdown, mark assist impact per goroutine, scheduling latency comparison (during GC vs normal), per-cycle breakdown (verbose), and sweep summary. Change --gc default to true since it now provides useful context. Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
Set gc: true in testOpts to match the new default, and regenerate golden files to include the GC analysis section. Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
1s trace from a single-node cluster at ~20% CPU showing GC mark assist impact even under light load (2 GC cycles, 5.5x p99 latency during GC). Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
Add "@ t=NNms" to the mark assist top-affected-goroutines output, showing when the longest assist started relative to trace start. Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
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
EventRangeBegin/Active/End) into a newgc_rangestable, replacing crude pattern-matching ong_transitionsreason strings--gcoutput with comprehensive analysis: cycle summary, STW breakdown, mark assist impact per goroutine, scheduling latency during GC vs normal, per-cycle breakdown (verbose), and sweep summary--gcdefault totruesince it now provides useful, low-noise contextExample output (from
experiment-upsert1000-gateway.bin):Test plan
go build ./...passes at each commitgo test ./...passes at each commitgc_rangespopulated with real GC data--gc=falsesuppresses section--verboseshows per-cycle breakdown