Significant baseline query load on postgres DB

I deployed my first app to Fly yesterday along with a postgres cluster. It all seemed to be working fine (prior to the ongoing incident).

I was checking out the metric for my postgres cluster and noticed that there seems to be a baseline query load of ~15 queries/s coming from the postgres user (or does postgres refer to the DB, somthing else - not sure what datname refers to).

This is with basically zero traffic to my app. Is this expected? Can anyone explain what these ~15q/s are for?

1 Like

Hello, I have deployed a simple elixir app by following the docs (Build, Deploy and Run an Elixir Application). This docs have instructions on connection a Postgresql db to that app. When I tried checking out the database metrics, I saw around 15 queries per second. All the queries were like this:

sum(pg_stat_database_numbackends{app="hello-elixir-db-serafeim"}) by (datname)

Could you please explain to me what’s the point of that query that is run 15 times per second!

Notice that this is an empty app and the database is not used at all!

I guess everyone is looking at DB metrics today!

This is normal for clustered postgres. The bulk of these queries are replication and health check related. The haproxy that sits in front of postgres, for example, runs two queries against each postgres node very frequently for health checks.

It’s not really load, though, these kinds of queries are “free”.

1 Like