In Azure, specifically within the context of services like Azure Load Balancer, a probe refers to a health probe. Azure Load Balancer rules require a health probe to detect the endpoint status of the backend instances within a pool.
Understanding Azure Health Probes
Azure Health Probes are essential for maintaining the availability and reliability of applications running behind a load balancer. Their primary function is to periodically check the health status of the virtual machine instances or other endpoints in the backend pool.
Why Use Health Probes?
Health probes play a critical role in how a load balancer distributes incoming traffic:
- Detect Endpoint Status: As mentioned in the reference, health probes are used to detect the endpoint status of backend instances. This means verifying if an instance is online and responsive.
- Determine Traffic Distribution: The reference states, "The configuration of the health probe and probe responses determines which backend pool instances receive new connections." If an instance fails the health check, the load balancer stops sending new traffic to it.
- Detect Application Failure: You can use health probes to detect the failure of an application, not just the VM itself. By probing a specific application endpoint (like an HTTP path), you can ensure the application is functioning correctly, not just that the port is open.
- Enhance Availability: By directing traffic only to healthy instances, health probes ensure that users are served by functional parts of your application, improving overall service availability.
How Azure Health Probes Work
The Azure Load Balancer sends periodic probe requests to the specified protocol and port on each instance in the backend pool. Based on the response received (or lack thereof) within a configured timeframe, the load balancer determines the health state of that instance.
- Healthy: The instance responds as expected within the timeout.
- Unhealthy: The instance fails to respond, responds incorrectly, or takes too long.
If an instance is marked unhealthy, the load balancer stops sending new connections to it until it passes the health checks again.
Configuration and Customization
You can configure various aspects of the health probe to match your application's needs. Key parameters include:
- Protocol: TCP, HTTP, or HTTPS.
- Port: The target port on the backend instances to probe.
- Interval: How often the probe attempts to check the instance (e.g., every 5 seconds).
- Unhealthy Threshold: The number of consecutive probe failures required before an instance is marked as unhealthy.
- Path (for HTTP/HTTPS): A specific URL path to probe (e.g.,
/healthcheck
). This allows for deeper checks of application health rather than just port availability.
The reference also notes that you can generate a custom response to a health probe. For HTTP/HTTPS probes, applications can be designed to return specific HTTP status codes (like 200 OK for healthy) and potentially a response body that the load balancer expects.
Common Health Probe Types
Azure Load Balancer supports different types of health probes:
Probe Type | Protocol | Description | Best For |
---|---|---|---|
TCP | TCP | Checks if a TCP connection can be established. | Basic service availability check. |
HTTP | HTTP | Checks for an HTTP GET response (default 200 OK). | Application responsiveness check. |
HTTPS | HTTPS | Checks for an HTTPS GET response over TLS/SSL. | Application responsiveness check over TLS |
Choosing the right probe type depends on your application's needs. HTTP/HTTPS probes with a specific path offer a more robust check of application health compared to a basic TCP probe.
Practical Considerations
- Probe Path: Use a lightweight, reliable endpoint for HTTP/HTTPS probes that reflects the application's overall health without being resource-intensive.
- Response Codes: Ensure your application returns appropriate HTTP status codes (e.g., 200 OK) for healthy responses to HTTP/HTTPS probes.
- Monitoring: Monitor the health status reported by the load balancer to quickly identify issues with backend instances.
In summary, a probe in Azure, particularly in the context of Load Balancers, is a mechanism to monitor the health and availability of backend endpoints, ensuring traffic is only sent to instances capable of processing requests.