Skip to content

Blog 4 min read

Meet DBFrog: one binary that watches five database engines

By Dennis Zimmer

Most teams learn how their database behaves on the day it misbehaves. This series does it the other way round: we break 15 databases on purpose and look at what a database monitoring tool shows while it happens. The tool is DBFrog. This first post explains what it is and how the test bench is built. The next four go engine by engine.

What DBFrog is#

DBFrog is one program. It polls the statistics views of each database once a second with read-only queries, keeps the history in a local SQLite file, and serves a web interface over HTTPS. There is no agent on the database host, no extension to install on the server side beyond what the engine already ships, and no separate time series store to run.

It speaks to five engines:

  • PostgreSQL 14 to 18
  • MySQL 8.0 and newer, and compatible servers
  • SQL Server 2017 and newer
  • Redis 6.2 and newer, and Valkey
  • MongoDB 6.0 and newer

The login it uses can read statistics and change nothing. dbfrog role-sql prints the setup script for each engine: pg_monitor on PostgreSQL, PROCESS and REPLICATION CLIENT on MySQL, VIEW SERVER STATE on SQL Server, a short ACL list on Redis, clusterMonitor on MongoDB. DBFrog suggests SQL for many findings, and never runs it.

The screen#

DBFrog showing a PostgreSQL 18 instance as a diagram of components, with three active alarms PostgreSQL 18 on the test bench. Three alarms are active.

The main view is a diagram of the engine: clients on the left, storage on the right, and the parts in between drawn as components connected by pipes. The pipes move at the speed of the real traffic. Each component has a light: green, amber or red. In the picture, Shared Buffers is red because the buffer cache hit ratio dropped under its limit, and Backend Processes is amber because one session waits for a lock.

Four more things matter in daily use:

  • Insights (top right) scans the server every five minutes for problems that are not spikes: a setting that will hurt later, a table without a primary key, an index nobody uses.
  • Drilldowns are live tables: sessions, blocking locks, top SQL, and about ten more per engine.
  • Thresholds let you set your own amber and red levels for each number, with the T button on every component.
  • The time slider at the bottom is the history. It is coloured by the worst state at each moment, with a line for activity on top. Drag it, and the whole diagram shows that moment.

The DBFrog PostgreSQL view with a 24-hour range on the time slider and a long red stretch PostgreSQL 17 over 24 hours. The long red stretch is a test from post 2: one forgotten transaction.

The test bench#

Everything in this series runs on one VM with 6 CPUs and 32 GB of memory. On it:

  • 15 database containers: PostgreSQL 16, 17, 18; MySQL 8.0, 8.4, 9; SQL Server 2019, 2022, 2025; Redis 6, 7, 8; MongoDB 7, 8, 9
  • a load script per engine that keeps a steady stream of normal traffic going
  • a chaos script that picks a problem at random every one to four minutes: a table lock, a connection spike, a slow query, a deadlock
  • DBFrog as a systemd service, watching all 15

After almost eleven hours of this, DBFrog itself used 74 MB of memory and about 2% of one CPU core, and wrote about 220 MB per hour to its history file. The file holds one day of per-second data and stays near 550 MB, because old seconds are rolled up into minutes.

Where it runs#

DBFrog needs a network path to the database and a login. That is all, so it fits most setups:

  • On the database host or a VM next to it. This is the only place where DBFrog also shows host CPU, memory and disk, because it reads them locally.
  • In a container or on Kubernetes, next to databases run by an operator. Start it with --console off so it writes plain log lines.
  • Against managed PostgreSQL: Supabase, Amazon RDS, Google Cloud SQL, Azure, Neon. From the database side these are PostgreSQL servers with a login, and DBFrog reads the same catalog views it reads anywhere else.

Two honest limits for managed services. First, there are no host figures: the provider owns the machine, so use the provider’s own metrics for CPU and disk. Second, we did not run this series against Supabase or any other managed service. The test bench is containers. What we can say is what DBFrog needs: PostgreSQL 14 to 18, a role with pg_monitor, and pg_stat_statements. On Supabase, use the direct connection string and not the transaction pooler, because a monitoring tool needs session settings to stay in place.

Some services are refused on purpose, with a clear message: Azure SQL Database and Synapse, a MongoDB mongos, and versions older than the ones listed above.

What comes next#

  • Post 2: the problems PostgreSQL hides
  • Post 3: MySQL locks, full scans and the table nobody indexed
  • Post 4: SQL Server blocking chains and a runaway query
  • Post 5: Redis, MongoDB and where all this runs

Each post shows what we broke, what appeared on the screen, and what did not. A monitoring tool that is only shown on its good days teaches nobody anything.

Keep reading

· Dennis Zimmer

The problems PostgreSQL hides

See PostgreSQL monitoring with DBFrog uncover idle transactions, dead rows, invalid indexes and sequence exhaustion in tests on PostgreSQL 16, 17 and 18.