-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could we add health check endpoints? #131
Comments
An health check endpoint would really help to use this tile server implementation in production environments. It should be respond with |
Is there a standard endpoint people use for this? |
I tend to use, Though it would make sense to have these URLs definable via the configuration file. |
From the terms mentioned, it's pretty clear that it's about deployment in Kubernetes. Therefore i would suggest to have a look into the following links:
I don't think that the startup sequence of the pg_tileserv requires a long time. So imho a startup probe is not really required. Liveness probe endpoint does only make sense if it's easiy to say the application is "dead" (e.g. deadlock) and where it makes sense to restart the application. From my point of view, the readiness check is the most relevant. It indicates whether the application can process requests. Most applications use a "/healthz" endpoint for this purpose. It can be used for both Kubernetes environments and environments where an external load balancer needs some information to verify that it is safe to forward requests to a specific application instance (running on a VM, container, etc will). Some applications also implement graceful shutdowns (e.g. via a SIGINT), where ongoing requests are still handled, but the healthz endpoint signals that new requests will not be accepted until the application finally terminates after a certain duration. Some other applications also allow the Healthz state to be set explicitly for maintenance purposes. |
Dedicated endpoints would be ideal, but in the meantime if anybody is looking for something basic for Kubernetes deployments, try a tcp connection check for the liveness probe (link below) and an HTTP request against the root index for the readiness check. |
We experienced lesser timeout using |
Another useful link PostgREST/postgrest#2092 |
I just learned that Azure DevOps--at least in a default configuration--tries to use "does it respond to an http[s] request at
I think @jrauschenbusch is right that this service starts up quickly enough to make separate startup and readiness endpoints unimportant, which is why I think that if a CI environment ever insists on having them we can get away with using the same handler at multiple paths. I don't think a dedicated startup handler would in practice be responding any sooner than a health / liveness / readiness one. I should be able to do this next week. |
Hi, could we add liveliness and readiness endpoint check? This is needed for deployment configs but I can not find the endpoint in the code.
The text was updated successfully, but these errors were encountered: