film42 / pgreba

A health-checking service for postgres
2 stars 5 forks source link

Add a cached data source to protect databases from health check volume #13

Closed film42 closed 3 years ago

film42 commented 3 years ago

I excluded stat replication and replication slots from the tests because we're probably going to remove those soon anyways.

When we wired this up to haproxy in prod we saw some db conn spikes. Did not impact db load but was making some connection charts look strange. This change will make it so we only perform a real db check once a second. Obviously caching a health check is a strange concept, but our health-checks run every 2 seconds so I think this is a safe change.

@benschinn