Load-Balancing

GCP負載均衡器非常高的健康檢查頻率

  • September 26, 2021

我在 GCP 上使用 HTTP 負載均衡器,通過 Kubernetes Ingress配置。

看起來健康檢查請求的數量非常頻繁:

10.0.4.1 - - [24/Apr/2018:17:53:25 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.128.0.5 - - [24/Apr/2018:17:53:25 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.128.0.7 - - [24/Apr/2018:17:53:25 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.128.0.5 - - [24/Apr/2018:17:53:25 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.128.0.7 - - [24/Apr/2018:17:53:25 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.0.4.1 - - [24/Apr/2018:17:53:25 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.128.0.5 - - [24/Apr/2018:17:53:26 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.0.4.1 - - [24/Apr/2018:17:53:26 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.128.0.7 - - [24/Apr/2018:17:53:26 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.128.0.5 - - [24/Apr/2018:17:53:26 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.128.0.5 - - [24/Apr/2018:17:53:26 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.128.0.7 - - [24/Apr/2018:17:53:27 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"
10.128.0.5 - - [24/Apr/2018:17:53:27 +0000] "GET / HTTP/1.1" 200 695 "-" "GoogleHC/1.0"

這是正常/預期的嗎?正如你所看到的,我用200s 回應。我還檢查了配置,輪詢間隔應該是 60 秒:

nathan@test-k8s-201417:~$ gcloud compute health-checks describe health-check-id
checkIntervalSec: 60

我的期望是每 60 秒進行一次健康檢查,而我看到的是每秒 100 秒!

這實際上是一種預期行為,因為 Google 探測器實際上發送的請求比您的健康檢查間隔要多。

但是您的後端健康檢查將被標記為健康或不健康,具體取決於您設置的時間間隔以及是否收到“200”條消息。這是一些解釋此行為的官方文件。

引用自:https://serverfault.com/questions/909263