google-cloud-platformgcp-load-balancer

How Does GCP Global Application Load Balancer Select the Closest Backend?


I'm trying to understand how the Google Cloud Platform (GCP) Global Application Load Balancer works, especially in scenarios involving proximity-based backend selection.

Here is the setup:

I have two Managed Instance Groups (MIGs) hosting my application.

I'm accessing the application from India.

My understanding so far:

Questions:

  1. Which specific component or object of the load balancer is responsible for selecting the nearest backend?
  2. What is the role of the Google Front End (GFE) in this process? Does the GFE perform the proximity calculations and backend selection?

I would greatly appreciate any insights or explanations regarding how the Global Load Balancer determines the nearest backend when both backends are healthy and capable of serving traffic.


Solution

  • Their documentation says:

    For backend services with instance groups, zonal NEGs with GCE_VM_IP_PORT endpoints, and hybrid NEGs, Google’s capacity management system informs first-layer GFEs about the used and configured capacity for each backend. The configured capacity for a backend is defined by the balancing mode, the target capacity of the balancing mode, and the capacity scaler.

    Standard Tier: First-layer GFEs select a second layer GFE in the region containing the backends.

    Premium Tier: First-layer GFEs select second-layer GFEs from a set of applicable regions. Applicable regions are all regions where backends have been configured, excluding those regions with configured backends having zero capacity. First-layer GFEs select the closest second-layer GFE in an applicable region (defined by network round-trip time). If backends are configured in two or more regions, first-layer GFEs can spill requests over to other applicable regions if a first-choice region is full. Spillover to other regions is possible when all backends in the first-choice region are at capacity.