健康狀態探查Health probes

為了判斷每個後端的健康情況,每個 Front Door 環境會定期向您設定的每個後端傳送一個綜合的 HTTP/HTTPS 要求。In order to determine the health of each backend, each Front Door environment periodically sends a synthetic HTTP/HTTPS request to each of your configured backends. 接著,Front Door 會使用來自這些探查的回應,來判斷它應該要路由傳送實際用戶端要求的「最佳」後端。Front Door then uses responses from these probes to determine the "best" backends to which it should route real client requests.

支援的通訊協定Supported protocols

Front Door 支援透過 HTTP 或 HTTPS 通訊協定傳送探查。Front Door supports sending probes over either HTTP or HTTPS protocols. 這些探查透過設定用於路由傳送用戶端要求之相同的 TCP 連接埠傳送,並且無法覆寫。These probes are sent over the same TCP ports configured for routing client requests, and cannot be overridden.

健全狀況探查回應Health probe responses

ResponsesResponses 描述Description
判斷健全狀況Determining Health 200 OK 狀態碼表示後端狀況良好。A 200 OK status code indicates the backend is healthy. 所有其他項目會視為失敗。Everything else is considered a failure. 如果基於任何原因 (包括網路失敗) 未收到有效的 HTTP 探查回應,則探查將會視為失敗。If for any reason (including network failure) a valid HTTP response is not received for a probe, the probe is counted as a failure.
測量延遲Measuring Latency 延遲是從目前我們傳送探查要求的那一刻起,到我們收到回應的最後一個位元組之前測量的時鐘時間。Latency is the wall-clock time measured from the moment immediately before we send the probe request to the moment when we receive the last byte of the response. 我們針對每個要求使用新的 TCP 連線,因此該度量不會偏向使用現有連線的後端。We use a new TCP connection for each request, so this measurement is not biased towards backends with existing warm connections.

Front Door 如何判斷後端的健康狀態How Front Door determines backend health

Azure Front Door Service 在所有演算法之間使用下述相同的三步驟程序來判斷健全狀況。Azure Front Door Service uses the same three-step process below across all algorithms to determine health.

  1. 排除已停用後端。Exclude disabled backends.

  2. 排除有健康情況探查錯誤的後端:Exclude backends that have health probes errors:

    • 藉由查看最後 n 個健全狀況探查回應來完成此選取。This selection is done by looking at the last n health probe responses. 如果至少 x 狀況良好,則後端會視為狀況良好。If at least x are healthy, the backend is considered healthy.

    • 透過變更負載平衡設定中的 SampleSize 屬性來設定 nn is configured by changing the SampleSize property in load balancing settings.

    • 透過變更負載平衡設定中的 SuccessfulSamplesRequired 屬性來設定 xx is configured by changing the SuccessfulSamplesRequired property in load balancing settings.

  3. 在後端集區中狀況良好的集合中,Front Door 還會測量並維護每個後端的延遲 (來回時間)。Out of the set of healthy backends in the backend pool, Front Door additionally measures and maintains the latency (round-trip time) for each backend.

完整的健全狀況探查失敗Complete health probe failure

如果後端集區中的每個後端的健全狀況探查失敗,那麼 Front Door 會將所有的後端視為狀況良好,並在所有後端的循環配置資源散發中路由傳送流量。If health probes fail for every backend in a backend pool, then Front Door considers all backends healthy and routes traffic in a round robin distribution across all of them.

一旦任何後端恢復狀況良好狀態,Front Door 將會繼續正常負載平衡演算法。Once any backend returns to a healthy state, then Front Door will resume the normal load balancing algorithm.

後續步驟Next steps