Skip to content
The Uptime Monitor That Kept the Database Awake

12 November 2026 · 2 min read

The Uptime Monitor That Kept the Database Awake

observabilityinfrastructure

For more than six days this site was down and I did not know. The cause was not a bug in the code. It was the thing I had set up to tell me when the site went down.

What the monitor did#

An Uptime Kuma monitor called /api/health every 60 seconds. That endpoint runs a trivial query, SELECT 1, to prove the database answers. It is the standard way to write a health check, and on a normal database it costs nothing.

The database here is Neon's free tier, which suspends compute after about five idle minutes and bills compute hours. A request every minute means the compute never idles, so it never suspends. Over a few weeks that burned through the monthly allowance, the project was blocked, and every request that needed the database failed.

Nobody was told#

The second failure is the one that stings. The Kuma instance had zero notification providers configured. It dutifully recorded the outage and told no one. A monitor that cannot reach you is a log file.

What I changed#

  • A longer interval, chosen with arithmetic. I first moved the check to 10 minutes, then worked through the numbers: since the suspend timeout is fixed on the free plan, a 10-minute ping still keeps compute active roughly half the time. A rough estimate put that at around 90 compute-hours a month from the health check alone, close to the whole allowance. At one hour it is closer to 15. Those are back-of-envelope figures, but the direction is not in doubt.
  • A notification channel. The monitor now sends a Telegram message when the site goes down or recovers.
  • A deeper fix later. An audit found that every page request and link prefetch was querying the database, so the app itself was a bigger consumer than the monitor. An in-process cache took care of that.

The rule I took from it#

A health check that touches the database is not free on a database that bills by activity. Decide what you want it to prove, and make sure the thing watching your site is itself watched, with a way to reach you.