brendangregg-use-tsa
Helps your agent find the root cause of performance issues in systems. It analyzes data to pinpoint where errors lie and how to fix them.
What it does
This agent helps figure out why a system (like a server or application) is slow or having issues. It uses specific methods to investigate system resources and task timing, finding the root cause of problems.
When to use it
- ✓When a server or application is slow and you don't know why.
- ✓After a change (like an update or increased load) that caused slowness.
- ✓When CPU, memory, disk, or network metrics look strange and need explanation.
Example of what to ask your AI
“My server is very slow, can you investigate the cause?”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
First, it asks about the problem. Then, it analyzes the utilization, saturation, and errors of each system resource (CPU, memory, network, disk). Next, it investigates how tasks (threads) spend their time to find bottlenecks.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add sickn33/agentic-awesome-skills --skill brendangregg-use-tsaOr download just the file:
curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/brendangregg-use-tsa/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
Brendan Gregg USE+TSA Performance Analysis
Overview
A fixed, evidence-first procedure for system performance debugging, root-cause analysis (RCA), and incident reporting, distilled from Brendan Gregg's published methodologies. Instead of running whichever commands happen to be familiar, the agent poses questions first and then finds metrics to answer them: the USE Method (Utilization, Saturation, Errors) sweeps every resource, the TSA Method (Thread State Analysis) decomposes thread time, and off-CPU analysis plus flame graphs drill into what the sweeps find. Every investigation ends in a structured triage note, RCA report, or postmortem where each claim traces to a command and its output.
This skill adapts material from the community repository thecsdoctor/brendangregg-use-tsa-skill (full checklists, reference library, and report templates live there).
When to Use This Skill
- Use when a server, VM, or container is "slow" and the cause is unknown
- Use when latency or throughput regressed after a deploy, config change, or load shift
- Use when CPU, memory, disk, or network metrics look abnormal and need interpretation
- Use when an application hangs or threads pile up
- Use when the user asks for debugging, triage, or root-cause analysis of a performance issue
- Use when an incident needs an RCA report or a blameless postmortem with an evidence trail
How It Works
Step 0: Problem Statement
Define the problem before measuring. Ask: What makes you think there is a problem? Has it ever performed well? What changed recently (software, hardware, load)? Can it be expressed as latency or run time — quantify it. Who else is affected? What is the environment (OS, versions, config, container/VM limits)?
Step 1: 60-Second Triage (Linux)
Run the ten-command sweep, checking errors and saturation first (easiest to interpret), then utilization. Record every exonerated resource.
uptime # load trend (includes uninterruptible I/O on Linux)
dmesg | tail # kernel errors: oom-killer, SYN flooding, hardware
vmstat 1 # r > CPU count = CPU saturation; si/so = swapping; wa = disk
mpstat -P ALL 1 # per-CPU imbalance (single hot CPU = single-threaded app)
pidstat 1 # per-process CPU over time
iostat -xz 1 # await (app-suffered latency), avgqu-sz, %util
free -m # memory; buffers/cache near zero hurts
sar -n DEV 1 # NIC throughput vs link limit
sar -n TCP,ETCP 1 # active/passive connections, retransmits
top # spot variable load
Step 2: USE Sweep (resource-oriented)
For every resource, check Utilization, Saturation, and Errors. Iterate CPUs, memory capacity, network interfaces, storage I/O and capacity, controllers, interconnects — plus software resources (mutex locks, thread pools, process/file-descriptor capacity) and imposed limits (cgroup quotas, hypervisor caps, ulimits). Check errors before utilization. Interpretations: 100% utilization is usually a bottleneck (confirm via saturation); any non-zero saturation can be a problem; non-zero, still-increasing error counters are worth investigating; and a clean sweep is a result — it narrows the search space.
Step 3: TSA Sweep (thread-oriented)
For each thread of interest, split time into: Executing / Runnable / Anonymous Paging / Sleeping / Lock / Idle. Investigate states from most to least frequent with state-appropriate tools. If more than ~10% of time is Runnable or Anonymous Paging, fix those first — latency states can be tuned to zero. Linux instruments: /proc/PID/schedstat run_delay and perf sched latency (Runnable), vmstat si/so and per-process min_flt (Paging), offcputime/cpudist from bcc (Sleeping), /proc/lock_stat and valgrind --tool=drd (Lock), pidstat/flame graphs (Executing).
Step 4: Drill Down
Follow the biggest contributor: Executing → CPU profile + flame graph; Sleeping/Lock → off-CPU stacks (offcputime -p PID, render with flamegraph.pl --color=io); latency complaints → time-division decomposition; microservices → RED method (Rate, Errors, Duration). Prefer eBPF in-kernel aggregation over per-event dumps; start with sub-second traces in production.
Step 5: Confirm Root Cause
…
FAQ
What are the USE and TSA methods?
USE (Utilization, Saturation, Errors) is a method to check the usage, saturation, and errors of all system resources. TSA (Thread State Analysis) is a method to analyze how task time is spent (executing, waiting, etc.).
What is 'root cause'?
It's the fundamental reason why a problem is happening. Finding the root cause helps fix the problem permanently.
What is a 'postmortem' report?
It's a document that describes an incident after it happened, detailing what occurred, what the cause was, how it was resolved, and what to do to prevent it from happening again.
Details
Original description by the author
Methodical performance troubleshooting and root-cause analysis with Brendan Gregg's USE and TSA methods, plus evidence-backed RCA and postmortem reports.
Popularity
- GitHub stars
- 48k
- Ranking position
- #2441
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
00-andruia-consultant
Helps your agent start or improve AI projects. It analyzes code, suggests tools, and creates action plans in Spanish.
sickn33/agentic-awesome-skills
007
Lets your agent perform security audits and threat modeling. It's useful for protecting projects against attacks and vulnerabilities.
sickn33/agentic-awesome-skills
10-andruia-skill-smith
Helps your agent create or improve AI tools. It defines how tools work, writes documentation, and validates the structure.
sickn33/agentic-awesome-skills
20-andruia-niche-intelligence
Lets your agent create a summary about a specific industry. It's useful for understanding the context, rules, usage patterns, and risks of a project, using reliable sources.
sickn33/agentic-awesome-skills
Similar skills
data-throughput-accelerator
Makes your agent speed up the movement of large data volumes. It finds bottlenecks and ensures data is transferred quickly and correctly.
affaan-m/ECC
inventory-demand-planning
Helps your agent predict product demand in stores. It optimizes stock and plans when to run promotions to sell more.
affaan-m/ECC
market-research
Helps your agent conduct market research and competitive analysis. Provides summaries with source attribution.
affaan-m/ECC