Cloudflare Docs
Learning Paths
Edit this page on GitHub
Set theme to dark (⇧+D)

Monitors and health checks

  2 min read

There’s more to a load balancer than just distributing traffic, however.

After all, what good would it be if your load balancer and pools send a request to a server that’s offline? Or one that’s already overloaded with traffic? Ideally, your load balancer should only forward requests that a server can take care of.

That’s where another part of the load balancing equation comes in: monitors and health checks.

​​ How it works

A monitor issues health checks periodically to evaluate the health of a each server within a pool.

These health checks are requests issued by a monitor at regular interval and — depending on the monitor settings — return a pass or fail value to make sure an origin is still able to receive traffic.

Each health monitor request is trying to answer two questions:

  1. Is the server offline?: Does the server respond to the health monitor request at all? If so, does it respond quickly enough (as specified in the monitor’s Timeout field)?
  2. Is the server working as expected?: Does the server respond with the expected HTTP response codes? Does it include specific information in the response body?

If the answer to either of these questions is “No”, then the server fails the health monitor request.

This system of request and response ensures that a load balancer knows which servers can handle incoming requests.