concept health check in category microservice

appears as: health checks, health check, The health check, health check
Microservices in Action

This is an excerpt from Manning's book Microservices in Action.

Health checks are binary: either an instance is available or it isn’t. This works well with typical round-robin load balancing, where requests are distributed to each replica in turn. But in some circumstances the functioning of a service may be degraded and exhibit increased latency or error rates without a health check reflecting this status. As such, it can be beneficial to use load balancers that are aware of latency and able to route requests to instances that are performing better, or those that are under less load, to achieve more consistent service behavior. This is a typical feature of a microservice proxy, which we’ll touch on later in this chapter.

gcloud compute health-checks create http api-health-check \
 --port=8080 \    #1  
 --request-path="/ping"    #1  

gcloud beta compute instance-groups managed set
➥-autohealing \    #2  
 market-data-service-group \    #2  
 --region=europe-west1 \    #2  
 --http-health-check=api-health-check    #2  

#1   The health check will make HTTP calls to :8080/ping.
#2   Associates the check with your existing instance group

Figure 9.14 The kubelet process on each worker node runs health checks, or probes, in Kubernetes. Readiness probe results control routing by services.

c09_14.png