3 ms·
(I am not 100% sure, but) I think this is done automatically. When you add an instance group behind a load balancer (https://cloud.google.com/compute/docs/insta
by alpb 8y ago
(I am not 100% sure, but) I think this is done automatically. When you add an instance group behind a load balancer (https://cloud.google.com/compute/docs/instance-groups/ https://cloud.google.com/compute/docs/instance-groups/) (which is what GKE Ingress does), the load balancer is aware of the health/CPU utilization of the backend VM instances.
With this information, the load balancer knows about the RPS (queries per second), CPU utilization, and number of connections established to each backend. In Kubernetes/GKE case, each "node pool" of a cluster is an "instance group" and GKE Ingress controller configures the LB with instance groups and health checks.
I believe the load balancing strategy (QPS, CPU, connections etc) is currently not configurable through Kubernetes since Ingress API does not have a good way of exposing cloud-specific configuration details, yet.
- puzzle 8y agoI see. Perhaps latency can be an alternate metric to divine capacity/maxqps, because you could have a backend that is not using a lot of CPU, but is still very slow, because it's just waiting on the local DB (which is the one melting down). If region X is Y ms away, you only start sending traffic there once the local backed is Y+Z ms slower than usual. The problem with such a metric is that it's hard to tell overload-induced latency from other kinds of high latencies. Health checks are good, but they tell you there's a problem seconds after you have already triggered it. :-) Better to have some concept of nominal capacity. Yeah, the Ingress API is not advanced at all and most people end up using controller-specific, non-portable annotations. I thought perhaps that was the case here. Hopefully there will be an improved API soon.