Skip to content

[Healthchecks] NLB health check #420

@levkk

Description

@levkk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    plumbingInfra stuff that's important to have but it's not that exciting to work on.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions