Repository navigation
Conversation
49d56ce to
340052e
Compare
QA LLM Review1. MEDIUM -- Skew verdicts can't fire on 2-worker replicas, which get "spread evenly" instead
DetailsWith two workers, This is the case the PR description motivates the drawer with: one worker pegged while A fix is to compare the busiest worker against the mean of the other workers. That gives 5× for |
340052e to
3c07311
Compare
QA LLM Review1. MEDIUM -- High-CPU verdict headline says "spread evenly" while its own body reports uneven work
This push turns uneven work under high replica CPU into a note on the DetailsThis branch is easy to reach. Take a 2-worker replica at one worker per core, with workers Before this push the headline was accurate, because an One fix is to drop "spread evenly across its workers" from the label when |
… cluster page Adds a Workers button to the redesigned cluster page's CPU chart. It opens a drawer that reads the replica's per-worker scheduling counters over one WebSocket session while open, and leads with a finding in the CPU troubleshooting guide's terms: a saturated or uneven worker, every worker busy, high CPU inside or outside running dataflows, idle, or balanced. Below it are the replica's CPU against its time running dataflows, the busiest and average worker over time, the busiest workers, and a table of objects with one bar per worker against an even share.
3c07311 to
e57a587
Compare
Motivation
Sixth PR in the cluster details redesign stack, on top of #39607. The CPU chart shows a replica's CPU as a share of its allocation, averaged over its workers. The CPU troubleshooting guide points out that a replica whose work sits on one worker can peg a core while reporting a modest
cpu_percent, and that high CPU with evenly spread work points elsewhere: an expensive object, ad-hoc queries, or an undersized cluster. The Console had no way to tell these apart.This adds a Workers button to the CPU chart. It opens a drawer that reads the replica's per-worker scheduling counters live and leads with a finding in the guide's terms.
Description
What it reads. The drawer reads only while open.
mz_scheduling_elapsed_per_worker(list_length(address) = 1), because a root's time includes its children.mz_compute_exports. Transient (t) exports pool into one "Ad-hoc queries and subscribes" row.clusterandcluster_replicaon the session.WebsocketQueryClient), held only while reading. An HTTP read would open a session each time, and a session start costsmz_catalog_serverabout 35 ms of CPU.statement_timeoutof 10s;replica_id, from 20 minutes before the drawer opens. The card's series can't be reused: past a 1h window they are per-bucket peaks, and past 24h they are polled.What it shows.
A verdict over the last 5 minutes:
The busiest worker is compared with the others' average, not with an average that includes it, which can't reach 2× on two workers. Only a saturated worker outranks high CPU. Uneven work under high CPU becomes a note on that verdict.
The skew verdicts name the object that took most of the busiest worker's time. They also give a copyable
EXPLAIN ANALYZE CPU WITH SKEWfor that object, pinned to the replica. Until 30s of readings exist, the drawer shows a first look from the lifetime counters instead.Two charts on one clock axis:
The busiest workers, each with the object it spent most of its time on. When nothing is skewed, this is one range covering all workers.
Where the CPU went: a UniversalTable with one row per object, measured since the drawer opened or since each dataflow started. Each row has:
Since the drawer opened, the share is % of the replica's CPU allocation, the CPU chart's unit. Objects, an "Other dataflows" footer and a line for work outside running dataflows add up to the replica's CPU. Over each dataflow's lifetime there is no common span, so the share is of all dataflow CPU instead. Objects under 1% of the dataflow CPU aren't flagged as skewed. Header tooltips define each column.
Counter semantics. A dataflow's time leaves the counters when it shuts down (
handle_shutdowninsrc/compute/src/logging/timely.rs). So the counters fall when a dataflow is dropped or the replica restarts.Supporting changes.
useObjectLinkis shared with the memory by object card.TimeAxistakes atickFormat.HoverOverlayandPercentScaleare exported.SubscribeCollectiongainsgetRows.workers.SessionVariablesincludesstatement_timeout.ChartHeadertakes anaction, and the CPU chart passes the Workers button through it.buildExtendedRequestQueryis exported.The drawer ships with the redesign, so it is behind the same UI preview flag and off in self-managed.
Cost.
mz_catalog_server: one session per stretch of reading, and one metrics SUBSCRIBE per open drawer.The read time on a large replica isn't measured yet. The backoff and the 10-minute cap bound it.
Verification
workerCpuModel.test.ts:workerCpuSampler.test.ts:WebsocketQueryClient.test.ts:ObjectCpuTable.test.tsx:WorkerCpuVerdict.test.tsx:EXPLAIN ANALYZE CPU WITH SKEW, pinned to the replica;🤖 Generated with Claude Code