Description
Add an HTTP endpoint that runs SELECT 1 or similar query on connection pools. This will tell NLBs that the PgDog instance is healthy. At least one target must succeed and health check fails iff all targets fail.
Implementation
Health checks should run async and the endpoint only:
- Responds with HTTP 200 if the health checks are recent and successful
- Doesn't actually run the health checks themselves. NLBs can be aggressive at calling this endpoint so it should be cheap to run.
We already run health checks regularly on all connection pools. This is controlled with idle_healthcheck_interval. I think we should just modify Pool to store last healthcheck timestamp and use that for the healthcheck endpoint.
Description
Add an HTTP endpoint that runs
SELECT 1or similar query on connection pools. This will tell NLBs that the PgDog instance is healthy. At least one target must succeed and health check fails iff all targets fail.Implementation
Health checks should run async and the endpoint only:
We already run health checks regularly on all connection pools. This is controlled with
idle_healthcheck_interval. I think we should just modifyPoolto store last healthcheck timestamp and use that for the healthcheck endpoint.