brendangregg-use-tsa
Qué hace
Este agente te ayuda a averiguar por qué un sistema (como un servidor o una aplicación) va lento o da problemas. Usa métodos específicos para investigar los recursos del sistema y el tiempo de las tareas, y encontrar la causa raíz de los problemas.
Cuándo usarla
- ✓Cuando un servidor o una aplicación va lento y no sabes por qué.
- ✓Después de un cambio (como una actualización o un aumento de carga) que provocó lentitud.
- ✓Cuando las métricas de CPU, memoria, disco o red parecen raras y necesitan explicación.
Link de la skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/brendangregg-use-tsa/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Mi servidor va muy lento. ¿Puedes investigar la causa?”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
Primero hace preguntas sobre el problema. Después analiza la utilización, la saturación y los errores de cada recurso del sistema (CPU, memoria, red y disco). Luego investiga cómo las tareas (hilos) emplean su tiempo para encontrar cuellos de botella.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de 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
…
Preguntas frecuentes
¿Qué son los métodos USE y TSA?
USE (Utilization, Saturation, Errors, es decir, utilización, saturación y errores) es un método para revisar el uso, la saturación y los errores de todos los recursos del sistema. TSA (Thread State Analysis, análisis de estados de hilos) es un método para analizar cómo se emplea el tiempo de las tareas (ejecutando, esperando, etc.).
¿Qué es la 'causa raíz'?
Es la razón fundamental por la que ocurre un problema. Encontrarla ayuda a solucionar el problema de forma definitiva.
¿Qué es un informe 'postmortem'?
Es un documento que describe un incidente después de que ocurrió: qué pasó, cuál fue la causa, cómo se resolvió y qué hacer para evitar que vuelva a suceder.
Detalles
Descripción original del autor
Methodical performance troubleshooting and root-cause analysis with Brendan Gregg's USE and TSA methods, plus evidence-backed RCA and postmortem reports.
Popularidad
- Estrellas en GitHub
- 48 mil
- Posición en el ranking
- #4055
- Licencia
- MIT
- Actualizada
- 15/10/2026
Comentarios
- …
Más skills de este repositorio
00-andruia-consultant
48 milAyuda a tu agente a iniciar o mejorar proyectos de IA. Analiza código, sugiere herramientas y crea planes de acción en español.
007
48 milPermite que tu agente realice auditorías de seguridad y modelado de amenazas. Es útil para proteger proyectos contra ataques y vulnerabilidades.
10-andruia-skill-smith
48 milAyuda a tu agente a crear o mejorar herramientas de IA. Define cómo funcionan, escribe la documentación y valida la estructura.
20-andruia-niche-intelligence
48 milPermite que tu agente cree un resumen de un sector específico. Es útil para entender su contexto, normas, patrones de uso y riesgos, usando fuentes fiables.
Skills parecidas
gitcrawl
394 milPermite que tu agente busque en un archivo guardado de incidencias y pull requests de GitHub, agrupe duplicados y revise su estado actual en GitHub.
slacrawl
394 milPermite que tu agente busque y cuente mensajes en un archivo local de Slack, revise qué tan reciente es y lo actualice cuando haga falta.
goplaces
394 milAyuda a tu agente a buscar lugares, obtener sus detalles y reseñas, y resolver nombres de lugares usando Google Places, con salida JSON para scripts.