Notes
open one at a time
1.What it can cause
A hung instance keeps its share of requests and fails every one of them.
- A hung instance keeps its share of requests and fails every one of them.
- The autohealer trusts the same check, so the broken instance is never replaced. Someone has to notice and delete it by hand.
- The errors look like a bad deploy, so the search starts in the wrong place.
2.Why it is wrong
A health check proves only what it actually tests. TCP proves a port is open, not that the application works - and the autohealer trusts the same check.
A hung application that still holds the port open passes the check, keeps receiving traffic, and is never replaced by the autohealer - because the MIG uses the same check. One weak setting breaks both rotation and healing.
The idea
A health check proves only what it actually tests. TCP proves a port is open, not that the application works - and the autohealer trusts the same check.
Learn it
- Health checks · GCP 12.1
- Two health checks with two different jobs · GCP 12.2
3.How you would find it
gcloud compute backend-services describe legacy-backend-service --region=asia-southeast1 --format="value(healthChecks)"
gcloud compute backend-services describe legacy-backend-service \ --region=asia-southeast1 --format="value(healthChecks)" gcloud compute health-checks list \ --format="table(name,type,tcpHealthCheck.port,httpHealthCheck.requestPath)"4.The change that closes it
health check: HTTP, GET /health, 200 expected. Proves the app is actually responding.
- As found
- health check: TCP, port 80. Proves only that something is listening.
- Fixed
- health check: HTTP, GET /health, 200 expected. Proves the app is actually responding.
gcloud compute health-checks create http legacy-http-hc \ --port=80 --request-path=/health \ --check-interval=10s --timeout=5s \ --healthy-threshold=2 --unhealthy-threshold=3 gcloud compute backend-services update legacy-backend-service \ --region=asia-southeast1 --health-checks=legacy-http-hc