Google Cloud HTTP Load Balancer 健康检查发送了太多请求?

Google Cloud HTTP Load Balancer health checks sends too many requests?

我们在 Google 云中设置了 Wordpress(如果重要的话,在 Google 容器引擎中设置了 Kubernetes)并配置了一个 HTTP 负载均衡器。作为这样做的一部分,我们设置了一个配置如下的健康检查:

但奇怪的是,当我跟踪 Wordpress 实例的日志时,它看起来像这样:

10.244.1.1 - - [21/Jan/2016:08:52:28 +0000] "GET /?healthCheck=true HTTP/1.1" 200 36784 "-" "GoogleHC/1.0"
10.244.1.1 - - [21/Jan/2016:08:52:30 +0000] "GET /?healthCheck=true HTTP/1.1" 200 36784 "-" "GoogleHC/1.0"
10.240.0.3 - - [21/Jan/2016:08:52:32 +0000] "GET /?healthCheck=true HTTP/1.1" 200 36784 "-" "GoogleHC/1.0"
10.244.1.1 - - [21/Jan/2016:08:52:33 +0000] "GET /?healthCheck=true HTTP/1.1" 200 36784 "-" "GoogleHC/1.0"
10.240.0.2 - - [21/Jan/2016:08:52:35 +0000] "GET /?healthCheck=true HTTP/1.1" 200 36784 "-" "GoogleHC/1.0"

即看起来健康检查每隔一秒发送一次(甚至更多?)。为什么会这样?

有多个运行状况检查程序可以对您的 VM 进行运行状况检查,以在一个运行状况检查程序出现异常或故障时提供冗余。他们每个人都遵守配置的健康检查频率。

Google 使用多个系统对探测器进行健康检查,这就是您看到多个请求的原因。来源:https://cloud.google.com/load-balancing/docs/health-check-concepts#multiple-probers

在同一份文件中,他们解释说这些多个系统中的每一个仍将遵守您定义的检查间隔:https://cloud.google.com/load-balancing/docs/health-check-concepts#probes

所以,我的理解是,您可以定义他们检查服务健康状况的频率,但您不能定义同时有多少个系统运行检查健康状况。

请注意这一点以及在 GCP 中创建健康检查。

要为 Google LB 的运行状况检查添加一些强制性 ingress 规则。

https://cloud.google.com/load-balancing/docs/health-check-concepts#ip-ranges