Is It the Cache, the Database Locks or the Gateway? Deeper Read-Only Diagnostics
“The app is slow” and “we get 502 errors” are two of the most common technical tickets and two of the least specific. TicketResolve’s root-cause engine gains read-only diagnostics for cache health, database deadlocks and slow queries, gateway errors by upstream, failing dependencies and Kubernetes events, all from data you already send.

"The app is slow" and "we get 502 errors" are two of the most common technical tickets, and two of the least specific. A slow app can be the database, the cache, the infrastructure or a third party. A 502 can come from the gateway or from whatever is behind it.
Here's how a "the app is slow" ticket usually unfolds at a company that runs an online grocery platform. Monday morning, several customers say the order page is crawling.
- The on-call engineer checks the database dashboard. Latency looks a bit high. She restarts a database connection pool. No change.
- A second engineer looks at the gateway: lots of 504s. He raises the gateway timeout. Pages still slow, now with fewer errors and longer waits.
- An hour later, someone checks Redis: the hit rate has fallen from 92% to 41% since a deploy changed the cache key format. Every request now goes to the database.
Each engineer tested the cause they knew best. Nobody tested the possibilities against each other, and the cache was the last thing checked.
TicketResolve's root-cause engine keeps competing hypotheses and runs the diagnostic that best tells them apart. This release gives it sharper ones. Like the rest, they're read-only, and they use data you already send: metrics, errors and traces.
First, the basics
- The root-cause engine keeps several possible explanations (hypotheses) at once and tests them with diagnostics.
- A diagnostic is a read-only check of your data that supports or counts against a hypothesis.
- A cache (such as Redis) stores frequently used data. Hit rate is how often the cache has what's asked for; evictions remove items to make room.
- A deadlock is two database operations waiting for each other. Lock waits and statement timeouts mean operations waited too long.
- A gateway or proxy sits in front of services. 502, 503 and 504 are gateway errors: bad response, unavailable, timed out. Upstream is the service behind the gateway.
- A dependency is something a service calls. A cascade is a failure spreading through dependencies.
- Kubernetes events report what's happening in a cluster: scheduling failures, failing probes, autoscaler problems.
- Traces follow a request across services.
Why does this matter? Vague tickets get fixed by guesswork: each engineer tries what they know. Testing every plausible cause with read-only diagnostics, and showing how each result moves the probabilities, finds the real cause first instead of last.
The problem, in plain terms
- "Slow" and "502" have many possible causes.
- Engineers test what they know best.
- Fixes are tried before causes are tested.
- Gateway errors are blamed on the gateway.
- Kubernetes problems hide behind restarts.
Cache health
A new hypothesis, Cache / Redis, joins the others, along with a diagnostic to test it. The diagnostic compares cache hit rate, evictions and latency with the same hours on previous days, and looks for Redis connection errors (ECONNREFUSED …6379, READONLY, CLUSTERDOWN).
- A hit rate down 20 points, evictions doubled or cache errors support it.
- Normal metrics count against it.
Database locks and slow queries
The existing database diagnostic compares latency and connection-pool saturation. The new one looks at lock contention:
- deadlocks
- lock-wait and statement timeouts
- slow-query errors and metrics
Each is compared with the same hours over the last week. If locks and slow queries are at their usual level, connection exhaustion is still checked separately, so neither check rules out the other's problem.
Gateway errors by upstream
A 502 means "the thing behind me didn't answer properly". This diagnostic splits 502, 503 and 504 responses in your traces by service, then looks at the calls behind them in the same traces:
- Gateway errors and failures upstream: the upstream service is the problem, and the gateway is just reporting it.
- Gateway errors and healthy upstream calls: the gateway or proxy itself is the problem.
Failing dependencies
Using the service dependency graph, the engine checks whether anything the affected service calls is failing at the same time: another service, a database, a cache, a queue or a third party. If it's part of a cascade, the likely origin is noted too.
Kubernetes events
Container health used to look only at crashing and restarting pods. It now also reads warning events from your cluster agent:
- scheduling failures (not enough CPU or memory)
- failing health probes
- an autoscaler that can't read metrics or scale
Still read-only, still evidence
None of these diagnostics changes anything in your systems, and none of them calls an AI model. Each result moves the probabilities of the hypotheses it tests, with the reason shown, and is recorded as evidence with its source. Unconnected sources are listed as "would help", never treated as evidence.
A worked example, start to finish
Here's the grocery platform's slow Monday, with the deeper diagnostics. The details are illustrative.
09:05. An investigation opens on the tickets: "Order page very slow." Hypotheses: database, cache / Redis, gateway, upstream service, infrastructure, third party.
09:06, first diagnostic: gateway errors by upstream. In the traces, order-page requests show 504s at the gateway, and the calls behind them, to orders-api, are slow too, but not failing. Gateway errors with slow, not failing, upstream calls: the gateway is reporting a slow upstream, not causing it. Gateway goes down; upstream: orders-api goes up.
09:07, the engine picks the next best diagnostic: cache health. Compared with the same hours on previous days:
- Hit rate: 92% → 41% (down 51 points): supports cache.
- Evictions: normal. Latency: normal. No Redis connection errors.
Cache / Redis rises sharply. The reason is shown: hit rate down 51 points vs the same hours last week.
09:08, database locks and slow queries. Slow-query errors up 6× compared with the same hours over the last week; no deadlocks or lock waits. Connection exhaustion, checked separately: pool at 70%, normal. Database is a consequence, consistent with a cache miss storm, not the origin.
09:09, failing dependencies. From the dependency graph: orders-api calls the cache (failing to serve hits) and the database (slow). Likely origin of the cascade: the cache.
09:09, Kubernetes events. No scheduling failures, failing probes or autoscaler problems. Infrastructure goes down.
09:10, unconnected. The CDN isn't connected; listed as would help, not as evidence.
09:12. The leading hypothesis: cache / Redis, with evidence. The engineer checks the morning's deploy: the cache key format changed, so every key misses. She reverts the key change. Hit rate back to 90% by 09:25. Nobody restarted a pool or raised a timeout.
Five more real-world scenarios
1. A 502 with healthy upstream
Situation. The gateway returns 502s while upstream calls succeed.
How TR handles it. The gateway or proxy itself is the problem.
2. Locks are normal, but the pool is full
Situation. No lock contention, but connections are exhausted.
How TR handles it. Connection exhaustion is checked separately, so it's still found.
3. Pods can't schedule
Situation. New pods stay pending.
How TR handles it. Scheduling failures from Kubernetes events count as evidence.
4. Redis is read-only
Situation. The logs show READONLY errors after a failover.
How TR handles it. Cache errors support the cache hypothesis.
5. No tracing
Situation. The service doesn't send traces.
How TR handles it. Diagnostics that need traces list them as "would help".
Before and after
Before. A restarted pool, a raised gateway timeout, and the cache found an hour later, after each engineer tried what they knew.
After. Gateway errors split by upstream, a 51-point drop in cache hit rate found in the second diagnostic, the database shown as a consequence, the cache named as the cascade's origin, and a revert within twenty minutes.
How to tell it's working
- Vague slowness tickets reach a leading hypothesis faster.
- Fewer "fixes" applied before the cause is tested.
- Gateway errors are attributed to the right service.
Who it's for
- On-call engineers and SREs.
- Support engineers escalating vague technical tickets.
- Platform teams running Redis, databases, gateways and Kubernetes.
How it fits with the rest of TicketResolve
These diagnostics are part of the root-cause engine in investigations. They use telemetry, traces, the service dependency graph and the cluster agent, and feed the evidence ledger.
How the engine chooses the next diagnostic
The engine doesn't run every check in a fixed order. After each result, it looks at the hypotheses still in play and picks the diagnostic most likely to separate them. In the example, the gateway check came first because it splits "gateway" from "something behind it" in one step; once the upstream was implicated, the cache check was the most informative next one. That's why the cache, which an engineer checked last on the bad Monday, was checked second here.
What "compared with the same hours" means
Most of these diagnostics compare today with the same hours on previous days or over the last week, not with an average. Traffic, cache hit rates and slow queries follow daily patterns: Monday morning is not like Sunday night. Comparing like with like means a change stands out because it's unusual for that time, not because the day is busy.
Mistakes to avoid
- Applying fixes before testing causes.
- Raising gateway timeouts for slow upstreams.
- Ignoring "would help" sources. Connecting them makes the next investigation sharper.
Do it in TicketResolve, step by step
Where: the investigation's root-cause view (/dashboard/investigate). You'll need: metrics, errors and traces connected; the cluster agent for Kubernetes events. Full guides: TR Investigate: from a ticket to a verified fix and How the investigation engine works.
- Connect telemetry: metrics, errors and traces you already send.
- Install the cluster agent for Kubernetes events, if you run Kubernetes.
- Open an investigation. Read the competing hypotheses.
- Follow each diagnostic: what it checked, the result, and how the probabilities moved.
- Check failing dependencies and the likely origin of a cascade.
- Read "would help" for sources not connected.
- Confirm the cause yourself before acting.
How to check it worked: each diagnostic shows its source, result and the reason the probabilities moved.
Frequently asked questions
Do these diagnostics change anything? No. They're read-only.
Do they use AI? No. None of them calls an AI model.
How is cache health judged? Hit rate, evictions and latency against the same hours on previous days, plus Redis connection errors.
What counts against the cache? Normal metrics.
How are gateway errors split? By service in your traces, then by the health of the upstream calls behind them.
What Kubernetes events are read? Scheduling failures, failing health probes and autoscaler problems.
What if a source isn't connected? It's listed as "would help", never treated as evidence.
Does the engine pick a cause? It moves probabilities with reasons; a person confirms.
Can a diagnostic rule out two causes at once? Not by itself for locks and connection exhaustion: they're checked separately, so neither check rules out the other's problem.
Explore Topics
Written by
Ghulam Shabbir
Content creator and writer sharing insights and stories.


