---
title: Database Monitoring: what to watch (and why)
description: When the database struggles, everything that depends on it struggles too — usually as timeouts and slow pages. Here's what to monitor so the DB never becomes your silent bottleneck.
canonical: https://watchfor.io/blog/database-monitoring
---

# Database Monitoring: what to watch (and why)

2026-02-16 · WatchFor Team · Monitoring · monitoring, databases

When the database struggles, everything that depends on it struggles too — usually as timeouts and slow pages. Here's what to monitor so the DB never becomes your silent bottleneck.

Behind a surprising number of "the site is slow" and [504 timeout](/blog/504-gateway-timeout) incidents sits the same quiet culprit: the **database**. Apps wait on it, and when it slows, the slowness ripples outward into every page and API call. Yet the database is often the *least*-monitored part of the stack. Let's fix that.

## Why the database deserves special attention

Your app might be fast and your servers healthy, but if a query is crawling, users feel it everywhere. The database is a **shared dependency** — one slow query or an exhausted connection pool can degrade the entire application at once. Monitoring it turns "the app is randomly slow sometimes" into a specific, fixable cause.

## What to watch

| Signal | Why it matters |
| --- | --- |
| **Query latency** | Slow queries are the #1 cause of slow apps |
| **Slow query log** | Pinpoints *which* queries to fix |
| **Connections** | A full connection pool blocks new requests |
| **Errors** | Failed queries, deadlocks, constraint violations |
| **Replication lag** | Replicas falling behind serve stale data |
| **Cache hit ratio** | Low ratios mean the DB is working too hard |
| **Disk & memory** | A full disk or thrashing memory takes the DB down hard |

### Query latency and slow queries

This is the big one. Track how long queries take — and especially the **[p95/p99](/blog/latency-percentiles-p99)**, because the slowest queries cause the most pain. The **slow query log** is gold: it names the exact queries crossing your threshold, which is usually where a missing index hides.

### Connections

Databases allow a limited number of simultaneous connections. When that **pool is exhausted**, new requests can't get a connection and just wait — which surfaces as timeouts in your app even though the DB itself is "up." Watch connection count against the limit.

### Replication lag

If you use read replicas, **lag** means replicas are behind the primary — so reads return stale data, and a failover could lose recent writes. Spiking lag is an early warning of trouble.

## Watch the trend

> **A slow query rarely arrives suddenly — it grows.** A query that was fine at 10,000 rows crawls at 10 million. Watching latency *over time* catches the gradual slide before it becomes an outage, and points you at the query to optimise (usually with an index).

## Connecting it to user impact

Database problems show up to users as application symptoms — timeouts, slow pages, [504s](/blog/504-gateway-timeout). That's why DB monitoring pairs so well with [uptime and response-time monitoring](/blog/uptime-monitoring-101): the external checks tell you *something* is slow, and the database metrics tell you *it's the DB, and here's the query*.

## The bottom line

| Watch | The risk it catches |
| --- | --- |
| **Query latency / slow log** | The #1 cause of slow apps. |
| **Connections** | Pool exhaustion → app-wide timeouts. |
| **Errors & deadlocks** | Failed operations and contention. |
| **Replication lag** | Stale reads and risky failovers. |
| **Disk / memory** | Hard, sudden database outages. |

The database is the shared dependency everything leans on. Watch query latency and the slow log first, keep an eye on connections and replication, and focus on trends — and the DB stops being the mystery behind your "randomly slow" days.

Related: [504 Gateway Timeout](/blog/504-gateway-timeout), [latency percentiles](/blog/latency-percentiles-p99), and [server monitoring basics](/blog/server-monitoring-basics).

---

Canonical page: https://watchfor.io/blog/database-monitoring · All articles: https://watchfor.io/blog/all.md · Site guide: https://watchfor.io/llms.txt
