Insights

Why is the application slow when the servers look fine?

QuestionPerformance and capacity

The application is slow because the request is waiting, not because the CPU or memory is full. The wait is usually a database query or lock, a full connection pool, a slow downstream call or a single saturated thread, and a host-level average hides all of these. To find it, trace one critical journey, read a percentile instead of the average, and split the time by component.

01

Why don't the CPU and memory charts show the slowness?

Because they measure how busy the machine is, not how long a request waits. A request's finish time has two parts: the time it spends running on a processor, and the time it spends waiting for something else. The CPU chart shows only the first part, and only as an average.

finish time = time running + time waiting

Waiting does not need a busy CPU. While a thread waits for a query, a lock, a free connection or another service, the processor is idle, so the chart stays calm. The averaging hides even more:

  • Averaged across cores. On a many-core host, one busy thread can fill one core while the host average stays low. A blocked event loop, as in Node.js, is the same single-threaded case.
  • Averaged over time. A one-minute reading of 20% can hide a few seconds at 100%, and the requests that arrived in those seconds had to queue.
  • Averaged across requests. Most attempts can be fast while a few wait for seconds. The average looks fine; the customers in the slow tail do not agree.

The terms used on this page:

Time running
The request is on a processor, doing its own work.
Time waiting
The request is blocked: on a query, a lock, a pool, a thread or another service.
Host average
CPU or memory averaged across cores and machines. It hides one hot core and one slow journey.
Tail latency
The finish time of the slow attempts. The 95th percentile is the time within which 95% of attempts finish. Compute it from all attempts or from a combined histogram, not by averaging the 95th percentile of each host.

The USE method (utilisation, saturation, errors) asks three questions of every resource: how busy it is, how long work waits for it, and whether it is failing. A low CPU reading answers only the first question, and only for the processor.

02

What usually makes a slow application wait?

Most often a database query, a full pool or a slow downstream service. The table below maps what you see to where to look next. A row is a place to look, not a verdict, and one journey can match more than one row.

What you see What it often means What to open next
CPU and memory look calm, and the journey is slow The request is waiting, not running One trace of a slow attempt
The average looks fine, and people still complain The slow attempts sit in the tail The 95th and 99th percentile of that journey
Application CPU is low, and database time is high A query, a lock or a wait for a connection Query time, lock waits, pool wait
Load average or run queue is high, and CPU use is low Work is blocked on disk or storage I/O Disk latency and queue (iowait, await), and the query's reads
Threads or connections sit at the cap New work queues before it starts Slots in use against the cap, and queue wait
One downstream call dominates the trace The wait is in that dependency or in a third party That call's latency, errors and timeouts
One core or one instance is busy, and the host average is not A single thread or instance is saturated Per-core and per-instance figures
The container or VM is slow, and the host chart is moderate CPU quota throttling or VM steal Throttled time against the CPU limit, steal time
Slow attempts line up with a pause, a limit or a batch job Garbage collection, a rate limit or scheduled work GC logs, rate-limit counters, the schedule
The first call is slow, and the next one is not DNS, TLS or a cold connection Setup time against a call that reuses the connection

The four most common waits in more detail:

  • Database query. A slow query is not always a busy database. It may read too much from disk, miss an index, sit on a lock, or wait for a free connection before it starts. If database CPU is low too, look at the reads, the lock waits and the pool wait, not at a larger host.
  • Connection pool or thread pool. When the cap is reached, new work queues. CPU stays low because the queued work has not started. The pool chart and the queue time are the evidence; the host average shows nothing.
  • Downstream dependency. When the journey calls another service, including a third party, the time is spent in that service while your CPU is idle. Its latency, its errors and the timeout you configured are the evidence. Retries against a slow dependency multiply the wait.
  • Garbage collection, rate limits and connection setup. A GC pause, a rate-limit counter or a slow first connection can line up with the slow attempts while the CPU average looks acceptable. Look at these when the trace shows time you cannot yet explain, not first.

03

How do you find where a slow application spends its time?

By following one slow attempt end to end and splitting its time. Before you start, name the journey people mean and the hour they feel it, and agree how slow is too slow. If nobody will defend a limit, the trace has nothing to miss; communication in performance engineering describes what happens when teams never agree on it. Then:

  1. Take one slow attempt and trace it from the user action to the last call it makes.
  2. Read the 95th percentile, and the 99th if you have it. Set the average aside until the tail is understood.
  3. Split the attempt into queue wait, time in the application, time in the database and time in each downstream call.
  4. Mark each piece as running or waiting.
  5. Check the pools and thread caps before you read the host CPU.
  6. Check single cores and single instances before you trust an average across the fleet.
  7. Look at garbage collection, rate limits, DNS and TLS only if the split still has time you cannot explain.

If you have no tracing yet, request IDs in the logs, the database's slow-query log and the dependency's own timings give a rougher version of the same split. If you trace with sampling, keep the slow attempts (tail-based sampling); otherwise the trace you need is the one that was dropped. If you are worried that a tracing agent will slow the application down, see does APM monitoring slow down your application.

Internal journeys deserve the same treatment. A slow path inside the company is easy to accept as normal because no customer receipt shows it; why observability in internal systems is critical covers this case.

04

Worked example: one slow checkout

The figures are illustrative. Customers say the checkout is slow, but the host charts stay under the line the team already alerts on. The measurements for one hour:

What was measured Value
Average finish time 0.4 seconds
Most attempts About 0.2 seconds
95th percentile finish time 4.0 seconds
Host CPU while the slow attempts ran 15%
Memory Under the existing alert line
Split of one attempt at the 95th percentile 0.3 s in the application, 2.5 s on one database query, 1.2 s on one payment call
Database CPU during that query 25%

The average of 0.4 seconds would look fine on most dashboards, but the 95th percentile is 4.0 seconds, and that is what customers feel. Most attempts are fast and a few wait a long time: this shape points to a wait, such as a lock or a full pool, rather than to slow code.

Of the 4.0 seconds, only 0.3 are spent in the application; 3.7 are waits, 2.5 on the query and 1.2 on the payment call. A host CPU of 15% and a database CPU of 25% do not explain a 2.5-second query. The next step is the query itself: its plan, the rows and pages it reads from disk, and any lock it waits on. After that, the payment call's own latency. Adding an application server would not shorten either wait.

05

What do you change once you know where the time goes?

The split decides the next step. There are three typical outcomes:

  1. The time is a query, a lock or a pool wait. Fix that wait. Another machine would often wait in the same place, or move the queue to the database.
  2. The time is one downstream call. Talk to the owner of that service. The size of your host does not set their latency.
  3. The time is real work on a core or host that is already full. Only in this case is the CPU chart, read per core and per instance, the right evidence, and a larger or additional host a real candidate. Whether the journey will then stay inside its limit during the busiest period is a separate question: see will your system handle peak load.

A very common case is the team that assumes more machines are the fix because many people use the application at once. When the system is already slow with few concurrent users, the time is usually in the database: the shape of the queries, indexes that are not used, inefficient calls. Without looking at where the time went, buying machines is a guess. When scaling is not the solution describes such a decision in detail.

The chart can be right about the host and still silent about the wait.

06

Conclusion

When the application is slow and the servers look fine, the servers are usually telling the truth: they are not busy. The request is waiting somewhere, on a query, a lock, a full pool or another service, and a host-level average cannot show where. What follows is about the order of work, not about the dashboards: first find where one slow journey spends its time, then choose the fix. More servers help only when the split shows real work on a full resource; otherwise they repeat the wait or move it to the database.

To start, pick the journey people complain about, trace one slow attempt, and split its time into running and waiting by component. Slowness also has a business price, and a partial slowdown belongs in it: see what an hour of downtime costs.

Review and improve starts from one critical journey and the evidence of where it spends its time, then ranks what to change first: optimise, simplify, redesign or add capacity, as described on a critical service that slows when the business needs it. If the trace shows that the design of the journey itself is the limit, the question belongs to Design and build. Walk one slow journey through with us.

Insights

Application slowness: questions and answers

What is application slowness troubleshooting?

Finding where one slow journey spends its time when the host charts look healthy. Name the journey people complain about, read a percentile instead of the average, and split the time into running and waiting, then by component: the application, the database and each downstream call. The host CPU chart is not the first chart to open.

Why is the application slow when CPU is normal?

The CPU chart measures time the processor spent running, averaged across cores and hosts. A request can spend most of its time waiting, and that wait does not raise the average. One busy thread, a lock or a call to another service can make the journey slow while the chart stays normal. You see the wait on a trace.

What causes slow database queries?

A query is slow when it does extra work, waits on a lock, or waits for a connection before it starts. Common causes are a missing or unused index, a query plan that reads too much from disk, and a lock held by other work. If database CPU is low, check locks and the connection pool before buying a larger host.

Can a connection pool make the application slow while CPU stays low?

Yes. When every connection or thread is in use, the next request waits for one to become free. CPU stays low because the waiting request has not started its work yet. Look at the slots in use against the cap and the time spent waiting for a slot. The host average does not show this queue.

Why do averages hide a slow application?

The average mixes the many fast attempts with the few slow ones. A journey can feel slow at the 95th percentile while the average stays under a green line. An average across hosts can also hide one saturated core or one slow instance. Use the percentile of the journey people complain about.

How do you find the bottleneck in a slow application?

Name one journey. Follow one slow attempt from the user action to the last dependency, using a trace. Split its time by component and mark each piece as waiting or running. Check pools, single cores and single instances before the host average. Look at garbage collection, rate limits, DNS and TLS only when the split still has time you cannot explain.

Is a slow page load the same problem as a slow application?

Not always. A slow page load can be caused by a large page, a slow front end or the network, before your servers do any real work. Application slowness is the wait after the request reaches your system: a query, a pool or a downstream call. Measure both ends. A front-end timing does not prove the servers are the cause, and a server chart does not prove the page is light.

Should we add servers when the application is slow?

Only when the trace shows the time is real work on a resource that is already full. If the time is a wait, another server often waits in the same place, or moves the queue to the database. Find out where the time goes before you buy machines.

Discuss your situation

Top