📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

📚 Interview question

What are the RED and USE methods? Explain rate, errors and duration, and utilisation, saturation and errors, which one you apply to a service and which to a resource like a database, node or thread pool, and what you would put on the dashboard for a .NET API.

Covers the RED method for request-driven services and the USE method for resources, how they map to built-in .NET and Azure metrics, how they relate to Google's four golden signals, and how to use them to structure dashboards and triage.

Intermediate Theory Intermediate dashboards golden-signals metrics observability red-method use-method

🎯 Key points

  • RED (Tom Wilkie): Rate, Errors, Duration per service and route
  • USE (Brendan Gregg): Utilisation, Saturation, Errors per resource
  • RED tells you users are hurting; USE tells you which resource is why
  • Saturation = queued work: thread pool queue, DTU/CPU wait, connection pool waits
  • Four golden signals = latency, traffic, errors, saturation (Google SRE book)
  • RED from http.server.request.duration; USE from System.Runtime, node and database metrics
  • Errors split by class: 5xx are yours, 4xx usually the caller's, plus timeouts
  • Same layout for every service so on-call can read any dashboard

⏱ 30-second answer

RED is for services that handle requests: Rate (requests per second), Errors (failed requests, usually 5xx and timeouts, as a ratio) and Duration (latency distribution, p50/p95/p99). It answers 'are users hurting?'. 4xx responses are normally the caller's mistake, so track them separately rather than in the error ratio.

USE is for resources: for each CPU, memory, disk, connection pool, thread pool or database, check Utilisation (how busy), Saturation (how much work is queued) and Errors. It answers 'which resource is the bottleneck?'.

In a microservice system you apply RED to every service and to its outbound dependencies, which lets you follow a problem downstream, then USE on the resources of the service at fault. In .NET, RED comes almost entirely from the built-in http.server.request.duration histogram; USE comes from System.Runtime (thread pool queue, GC), the container or node, and the database. The trade-off: RED is simple and user-centred but says nothing about cause, so you need USE underneath it to diagnose.

🗣 Full answer (senior)

How I would answer this in an interview

"They're two checklists for two kinds of thing. RED, from Tom Wilkie, is for anything that serves requests: an API, a gRPC service, a message consumer. For each service, and usually each route, I want the rate of requests, the errors among them, and the duration as a distribution. That's the customer's view: if RED is fine, users are fine, whatever the CPU graph says.

USE, from Brendan Gregg, is for resources: CPU, memory, disks, network, but also software resources like the thread pool, the database connection pool or a Service Bus queue. For each one I check utilisation (how busy it is), saturation (how much work is waiting) and errors. Saturation is the one people forget, and it's often the real signal: a CPU at 70% is fine, but a thread pool queue of 500 items means requests are waiting even though no single number looks maxed out.

On a .NET API I get RED almost for free: http.server.request.duration gives the count, which becomes rate, the status code tag gives errors, and the buckets give p50, p95 and p99. For USE I chart CPU and memory against the container limit, dotnet.thread_pool.queue.length and thread count, GC pause time, and for the database the CPU or DTU percentage, wait stats and connection pool waits. The four golden signals from the Google SRE book are essentially RED plus saturation.

The mistake I see is dashboards that start with CPU and memory. Those are causes. You start with RED to know whether there's a problem and how big it is, then drop to USE to find which resource is responsible."


RED vs USE

RED USE
Applies to Services, endpoints, consumers Resources (hardware and software)
Question Are users being served well? What is the bottleneck?
Signals Rate, Errors, Duration Utilisation, Saturation, Errors
Alert on it? Yes: symptoms users feel Mostly no: for diagnosis and capacity
Source in .NET http.server.request.duration, http.client.request.duration, consumer metrics System.Runtime, container/node metrics, SQL metrics

USE for common resources in a .NET system

Resource Utilisation Saturation Errors
CPU (container) CPU % of limit Throttled periods (container_cpu_cfs_throttled_periods_total) n/a
Memory Working set vs limit GC pause time, Gen2 frequency OOM kills
Thread pool Thread count dotnet.thread_pool.queue.length n/a
SQL connection pool Connections in use vs max Waits for a connection, timeouts SqlException count
Azure SQL CPU / DTU % Wait stats, blocked sessions Failed connections, deadlocks
Service Bus queue Throughput vs limit Active message count, message age Dead-lettered messages

Production example

During a sale, RED on the orders API showed p95 going from 150 ms to 1.8 s with errors still near 0%. USE showed pod CPU at only 55%, but dotnet.thread_pool.queue.length above 400 and SQL connection pool waits rising: a synchronous database call was blocking threads. Fixing it brought p95 back to 170 ms at twice the load.

🔍 What the interviewer is checking

Checks that the candidate has a structured way to choose metrics and to triage, rather than a pile of graphs.

Green flags

  • Separates services (RED) from resources (USE) clearly
  • Explains saturation with a .NET example such as the thread pool queue
  • Alerts on RED symptoms and uses USE for diagnosis
  • Knows which built-in .NET metrics supply each signal

Red flags

  • Lists metrics with no framework
  • Thinks utilisation alone shows a bottleneck
  • Treats all 4xx as service errors

📚 Learn in depth

1. Where the methods come from

  • USE (Brendan Gregg, about 2012): a systems performance method. For every resource, check utilisation, saturation and errors, so you don't miss a bottleneck by only looking at the obvious ones.
  • RED (Tom Wilkie, about 2015): adapted for microservices, where each service is a black box that receives requests.
  • Four golden signals (Google SRE book, 2016): latency, traffic, errors, saturation. RED plus saturation.

2. How they fit together during triage

        user impact?
  ┌──────────────────────┐
  │  RED per service     │  rate ↓? errors ↑? p95 ↑?
  └──────────┬───────────┘
             │ which service is the origin? (traces, dependency RED)
             ▼
  ┌──────────────────────┐
  │  USE per resource    │  CPU, memory, thread pool, DB, queue
  └──────────┬───────────┘
             ▼
        root cause (profiles, dumps, query plans)

RED on dependencies (http.client.request.duration, SQL dependency calls) lets you follow the problem downstream: if your p95 rose and your database call p95 rose by the same amount, look at the database's USE.

3. Utilisation vs saturation

Utilisation is the fraction of time a resource was busy. Queueing theory says latency rises sharply as utilisation approaches 100% (for an M/M/1 queue, waiting time is proportional to ρ / (1 − ρ)). At 50% utilisation the wait is 1× the service time; at 90% it is 9×. Saturation measures that queue directly, which is why it's the better early warning.

In .NET the thread pool is the classic example: CPU can be low while the queue grows because threads are blocked on I/O (sync-over-async). The pool injects new threads slowly (the hill-climbing algorithm adds roughly one or two per second once you are above the minimum), so the queue length shows the problem long before CPU does.

4. Errors: what counts

  • 5xx responses and unhandled exceptions: your fault, count them.
  • Timeouts and cancelled requests: often not logged as 5xx (client disconnects show as 499 in some proxies); count them separately.
  • 4xx: usually the caller's fault, but a spike in 401 or 404 after a deploy is a bug. Track them, but keep them out of the main error ratio.
  • For consumers: failed processing attempts, retries and dead-lettered messages.

5. RED for message consumers

Rate = messages processed per second, Errors = failed or dead-lettered, Duration = processing time and message age (time from enqueue to completion). For queues, the USE saturation signal is backlog and oldest message age.

6. Building the dashboard

One row of RED at the top (with SLO lines), one row of RED for each critical dependency, then USE rows for the runtime, the container and the database. Every service uses the same layout so anyone on call can read it.

Try it yourself

  1. Build a Grafana panel set with sum(rate(http_server_request_duration_seconds_count[5m])), the 5xx ratio and histogram_quantile(0.95, ...) for a sample API.
  2. Add Thread.Sleep(500) to a hot endpoint, run k6 and watch CPU vs dotnet.thread_pool.queue.length.
  3. Write the KQL equivalents on requests: count(), countif(success == false), percentile(duration, 95) by bin(timestamp, 1m).
  4. For a Service Bus consumer, chart active message count and the age of the oldest message.
  5. List every resource your service depends on and write down where you'd read U, S and E for each; the gaps are your missing metrics.

💻 Code

RED queries in PromQL and KQL, and a USE check with dotnet-counters:

# PromQL: RED for one service (OpenTelemetry metric names in Prometheus form)
# Rate
sum by (http_route) (rate(http_server_request_duration_seconds_count{service_name="orders-api"}[5m]))
# Errors (5xx ratio)
sum(rate(http_server_request_duration_seconds_count{service_name="orders-api",http_response_status_code=~"5.."}[5m]))
  / sum(rate(http_server_request_duration_seconds_count{service_name="orders-api"}[5m]))
# Duration (p95, merged across pods)
histogram_quantile(0.95, sum by (le) (rate(http_server_request_duration_seconds_bucket{service_name="orders-api"}[5m])))

# USE for the .NET runtime on one pod: thread pool saturation and GC
dotnet-counters monitor -n Orders.Api --counters System.Runtime[dotnet.thread_pool.queue.length,dotnet.thread_pool.thread.count,dotnet.gc.pause.time]
// KQL (Application Insights): RED per operation in 5-minute bins
requests
| where timestamp > ago(3h) and cloud_RoleName == "orders-api"
| summarize rate_per_s = count() / 300.0,
            error_ratio = round(100.0 * countif(toint(resultCode) >= 500) / count(), 2),
            p95_ms = percentile(duration, 95)
    by bin(timestamp, 5m), name
| order by timestamp asc
// RED for a queue consumer: one histogram gives rate, errors and duration
namespace Orders.Worker;

using System.Diagnostics;
using System.Diagnostics.Metrics;

public sealed class ConsumerMetrics(IMeterFactory factory)
{
    private readonly Histogram<double> _duration = factory.Create("Orders.Worker")
        .CreateHistogram<double>("messaging.process.duration", unit: "s");

    public async Task MeasureAsync(string queue, Func<CancellationToken, Task> handler, CancellationToken ct)
    {
        var start = Stopwatch.GetTimestamp();
        var outcome = "success";
        try { await handler(ct); }
        catch { outcome = "error"; throw; }
        finally
        {
            // count of records = rate, outcome tag = errors, buckets = duration
            _duration.Record(Stopwatch.GetElapsedTime(start).TotalSeconds,
                new("messaging.destination.name", queue), new("outcome", outcome));
        }
    }
}

⚠ Common mistakes

  • Mistake: Starting dashboards and alerts with CPU and memory. Why it is wrong: they are causes, not user impact, and high CPU is often fine. Instead: put RED at the top and alert on it; use USE to diagnose.
  • Mistake: Ignoring saturation. Why it is wrong: queues grow before utilisation looks full, especially the .NET thread pool and connection pools. Instead: chart queue lengths, waits and throttling.
  • Mistake: Counting 4xx as errors in the main error ratio. Why it is wrong: a client sending bad requests pages your team. Instead: track 5xx and timeouts as errors; watch 4xx separately for spikes.
  • Mistake: Applying RED only to the HTTP edge. Why it is wrong: queue consumers and dependencies fail silently. Instead: measure RED for consumers and for outbound calls.
  • Mistake: Using average duration in the D of RED. Why it is wrong: it hides the tail. Instead: use p50/p95/p99 from histograms.
  • Mistake: Treating container CPU % as utilisation without checking throttling. Why it is wrong: a pod at 60% average can be throttled hard in short bursts by its CPU limit. Instead: also chart CFS throttled periods.
  • Mistake: Building a different dashboard layout for every service. Why it is wrong: on-call wastes minutes learning each one at 3 am. Instead: one RED/USE template for all services.

🏛 Senior insight: trade-offs

RED and USE are checklists, not metrics. Their value is that they stop you missing things: RED keeps you honest about user impact, USE forces you to check every resource, including software ones like the thread pool and connection pool, where .NET services actually saturate first. A senior engineer also knows what each costs: RED is almost free from built-in instrumentation; USE needs metrics from several layers (runtime, container, database, broker) and someone to wire them together.

Method When it fits Cost When not to rely on it alone
RED Every request-driven service and consumer; SLOs and alerts Built in (http.server.request.duration) Diagnosing cause; batch jobs with no requests
USE Capacity planning, bottleneck hunting Metrics from runtime, node, DB, broker Deciding whether users are affected
Golden signals Teams following Google SRE practice Same as RED + saturation When you need per-resource detail

🔗 Follow-ups the interviewer may ask

  1. When: Candidate says every service should use the same RED/USE layout. Why: Checks they can turn the method into a practical dashboard.
    How to answer

    An incident dashboard must answer three questions in the first screen: are users hurting, since when, and where. So the top row is SLO status and error budget, then RED for the service (rate, 5xx ratio, p50/p95/p99) with the SLO threshold drawn on the panels. The next row is RED for each dependency (database, downstream APIs, queues) so you can see where the fault starts. Below that, USE panels for the runtime, pods and database, collapsed by default.

    Every time series carries deploy and feature-flag annotations, because most incidents follow a change, and panels link to traces and logs filtered to the same service and time window. One template as code with service and region variables serves every service.

    The trade-off: fewer panels make it faster to read, but you need drill-down paths for the detail you removed.

  2. When: Candidate says you alert on RED and diagnose with USE. Why: Checks they connect metrics to actionable alerting.
    How to answer

    Alert on symptoms users feel, such as the request error-rate or latency SLI, failed synthetic journeys or orders per minute dropping, because causes like CPU at 80% often hurt nobody and miss failures with no resource signal at all. The best symptom alert is SLO burn rate: how fast you are spending the error budget. With a 99.9% SLO, a 14.4× burn over 1 hour (confirmed over 5 minutes) spends 2% of a 30-day budget and pages; 6× over 6 hours pages; slower burns raise a ticket.

    Every alert needs who gets paged (the owning team's rotation), the threshold and window, a severity that decides page versus ticket, a dashboard link and a runbook with the first mitigation steps. Cause metrics stay on dashboards for diagnosis. The trade-off: fewer pages means a slightly later warning for slow-building problems, which tickets cover.

  3. When: Candidate mentions the thread pool queue or GC metrics. Why: Checks they know which tool to use next once USE points at the runtime.
    How to answer

    The .NET diagnostics tools all talk to the runtime over its diagnostics IPC channel, so they work on Windows, Linux and in containers without a debugger.

    • dotnet-counters shows live metrics (CPU, GC heap size, allocation rate, ThreadPool queue length, exceptions) with almost no overhead. It tells you what kind of problem you have.
    • dotnet-trace records an EventPipe trace with CPU samples and runtime events; it tells you where time goes.
    • dotnet-gcdump captures the managed heap graph (types, sizes and references). Comparing snapshots shows what is growing; the reference paths show what keeps it alive. dotnet-dump captures the whole process for SOS analysis of hangs and native memory.
    • dotnet-monitor wraps all of this as an HTTP API or sidecar with triggers, which is how you use them in Kubernetes or Container Apps.

    I start with counters because they are cheap, then pick the heavier tool the symptom points to. The trade-off is overhead and data sensitivity: a full dump contains every secret in memory.

🛠 Real-world problems: how you handle them

Low CPU, slow API: thread pool saturation found with USE
Situation
An orders API at [company] on [AKS], [8] pods, during a promotional sale at about [2x] normal traffic; checkout revenue at stake.
Signals
p95 latency up from 150 ms to 1.8 s; error rate still under 0.5%; pod CPU around 55%; autoscaler not adding pods because the CPU target wasn't reached.
Investigation
RED on the dependency row showed SQL call duration flat, so the database wasn't slow. USE on the runtime: Grafana showed `dotnet_thread_pool_queue_length` above 400 and thread count climbing slowly. `dotnet-counters` on one pod confirmed it; `dotnet-stack` showed threads blocked in `.Result` on a synchronous wrapper around an async SQL call.
Resolution
Immediately raised `ThreadPool.SetMinThreads` and scaled pods manually to stop the bleeding. The real fix made the call path async end to end. Also added thread pool queue length as an autoscaling signal alongside CPU.
Prevention
Added `dotnet.thread_pool.queue.length` and connection pool waits to the standard USE row; enabled analyser rules against sync-over-async (VSTHRD002 / CA1849); load test before each sale event.

How to tell it (STAR)

**S:** During a sale at [company], our orders API slowed to a 1.8-second p95 while CPU sat at 55%, so autoscaling did nothing. **T:** I was on call and needed to find the bottleneck fast. **A:** RED showed users were hurting but the database calls were not slower. Going through USE, I found the thread pool queue above 400 and threads blocked on a synchronous wrapper around an async SQL call. I raised min threads and scaled out manually to recover, then we made the path fully async and added thread pool saturation to the dashboard and autoscaler. **R:** p95 returned to 170 ms within [20] minutes, and the next sale handled [twice] the load with no incident.

↩ Usually asked after

More in Metrics

Last updated 23 Nov 2026.

🌐 Sangam's Webring

⏪ Previous 🏠 Main Next ⏩
💬 Chat with me