Performance Health / Troubleshooting

Status: Reviewed (deep-dive v1)
Stack: PowerShell (schedule off-peak collectors) → SQL DMV snapshots/procs → Blazor Server UI
Depends on: SQL-01 Inventory; use with SQL-03 (stats/indexes), SQL-04 (jobs), SQL-06 (disk pressure)
Goal: Ops-level visibility into waits, blocking, and expensive queries — not a full tuning engagement every time.


Why this next

Capacity and jobs tell you the plumbing. Performance health tells you whether the instance is hurting right now and what to look at first.

Keep this ops triage, not deep plan analysis essays.


What “good” looks like


Ops signals (start here)

Signal Why it matters First check
Blocking chain Users stuck Head blocker SPID/query
High wait (PAGEIOLATCH, WRITELOG, LCK_*, CXPACKET/CXCONSUMER, SOS_SCHEDULER_YIELD) Points at IO / log / locking / CPU / parallelism Correlate with disk (SQL-06) and jobs (SQL-04)
Top CPU / duration / reads Who’s burning the box Same query hash repeating?
Thread/worker pressure Scheduler starvation Concurrent jobs + parallelism
Plan cache bloat / single-use plans (optional later) Memory waste Ad-hoc workload

Checklist — collect (SQL first; PS schedules)

Run light, on a schedule (e.g. every 1–5 min for “now”; hourly rollups). Prefer DMVs; avoid traces unless XE already exists.

PS role: schedule Invoke-Sqlcmd / collector; optionally skip collect if host CPU already pegged by maintenance window flag.

Do not collect full plans for every query in v1 — text + query_hash + stats is enough for the board.


Checklist — store (SQL + stored procedures)

Table Purpose
dbo.PerfWaitSample Wait deltas by wait_type
dbo.PerfBlockingEvent Observed blocker/victim pairs (sampled)
dbo.PerfTopQuery Top N rows per sample (hash, stats, truncated text)
dbo.PerfSampleRun Run audit

Procs:

Retention: detail 7–14 days; rollups optional later.


Checklist — present (Blazor Server)


First 15 minutes runbook (slowdown page)

  1. Confirm scope: one DB, one instance, or estate?
  2. Blazor → Blocking now — if yes, identify head blocker; don’t kill without approval
  3. Hot waits — pick dominant family:
    - IO latch → SQL-06 disk / SAN / Autogrowth storms
    - WRITELOG → log disk / sync commit / VLF
    - LCK_* → long tran / blocking job / missing index smell
    - CPU / SOS_SCHEDULER_YIELD → top CPU queries; parallelism; runaway job (SQL-04)
  4. Top queries — same hash flooding? sudden new hash after deploy?
  5. Check Agent: index rebuild / CHECKDB / backup overlap (SQL-03/04)
  6. Stats: big load without update? (SQL-03)
  7. Capture evidence (screens/hashes/times) before changing anything
  8. Fix under change control; re-check board after next samples

Common failure patterns

Symptom Likely cause
Everything slow, PAGEIOLATCH Storage / memory pressure / cold cache after restart
Periodic stalls Agent job window; autogrowth; backup IO
One app stuck, others fine Blocking or app-side connection pileup
CXPACKET high Often symptom; check skew + Cost Threshold / MAXDOP policy with Rick
Board empty Collector rights; Agent stopped; wrong instance

Guardrails


Permissions notes


Done definition for this topic


Next candidates (when Rick directs)

Patching & build currency · HA/DR awareness · Alerting & runbooks


SQL Dude — SQL-07 Performance Health v1