Load Balancers on GCP
Load Balancers on GCP Let’s talk about the types of Load Balancers that we can find in GCP. What is a Load Balancer? Basically, as the name implies, it is a traffic entry point that has the main role of distributing a load among x number of
Source comparison and review notes
- Automated pair-review warning (AI bilingual content review): The Spanish article contains the detailed GCP load-balancer deployment-mode comparison table and four official GCP reference links; the English source omits that table and retains only its English demo link.
Let’s talk about the types of Load Balancers that we can find in GCP.

What is a Load Balancer?
Basically, as the name implies, it is a traffic entry point that has the main role of distributing a load among x number of backends. The main objective is to improve the availability, redundancy and efficiency of our services/applications by sharing the load “equally” among all our backend servers.
This is the main concept, but to this are added many features that will add value to this role, going from being a proxy tool or traffic transfer to a robust tool that will become a critical tool for the availability of our services.
How Does a Load Balancer Work?
When user or client requests arrive at an application or website, instead of going to a single server, they are sent to the load balancer. This, in turn, is responsible for distributing these requests among a group of available servers according to certain predefined rules or algorithms. Algorithms can be based on several factors, such as the minimum number of current connections, server processing capacity, or even latency.
Key features of CLB on GCP:
Unique Anycast IP Address:
Allows a single anycast IP address to act as the frontend for all backend instances globally, facilitating cross-region load balancing
Autoscaling
Able to scale according to user and traffic growth.
Software Defined Load Balancing:
It is a managed, distributed, software-defined service for all traffic.
Integration with Cloud Armor
Security integration that will allow us to protect ourselves from DDoS attacks and advanced protection.
SSL Offloading
It will allow us to simplify the management of certificates at the LB and application level.
Main categorization: L4 or L7
Layer 4 (L4) Load Balancers:
- They operate on the transport layer of the OSI model, making routing decisions based on IP addresses and port numbers.
- They are capable of handling TCP, UDP, and other transport layer protocols.

Layer 7 (L7) Load Balancers:
- They work at the application layer.
- It allows you to make more sophisticated routing decisions based on the content of requests, such as URLs, cookies, or HTTP headers.
- They are ideal for complex web applications that require routing based on application-specific behaviors.

Main Components of a Load Balancer
In this case, this section of this note can apply to most Clouds since, in general, all LBs have these components:
1. FrontEnd:
- It refers to the entry point configuration of our traffic (our access endpoint).
- It can be a Public or Private IP (depending on whether it is internal or external).
2. Backend:
- They are the final targets of traffic.
- The backend refers to the group of servers or instances that receive the traffic distributed by the Load Balancer.
- Backend servers can be organized into one or multiple backend groups, depending on specific needs.
3. Health checks:
- Health checks are automated tests that the LB performs regularly to ensure that the backend servers are working properly.
- Normally, for each traffic path we will test the traffic is specific to that workflow.
- This ensures that traffic is only directed to servers that are functioning properly.
- This point is fundamental for troubleshooting.
4. Traffic rules:
- Especially those operating on L7, routing rules can be defined to control how incoming traffic is handled. This can be based on features such as URLs, HTTP headers, or request methods.
- These rules allow you to implement complex behaviors, such as content-based load balancing, redirects, and URL forwards.
Types of Load Balancers in GCP
GCP Load Balancers have different types and subtypes. In general, the underlying technology implemented varies: Maglev, Andromeda, Google Front Ends, and Envoy are the products used in the GCP Backend to run load balancers.
Maglev
- Maglev is applied in Passthrough Network Load Balancers, optimizing large-scale traffic handling without altering the customer’s original IP address.
Andromeda
- Andromeda is used in Google’s VPCs and HTTPs and TCP/UDP Internal Load Balancers in private networks.
Google Front Ends (GFEs)
- Google Front Ends (GFEs) are used in External HTTP(S) Load Balancers and SSL Proxy Load Balancers, handling incoming Internet traffic and providing security and performance at the edge of the network.
Envoy
- Envoy is used in Internal HTTP(S) Load Balancers, enabling advanced routing and traffic management for microservices within the internal network.

Deployment Modes
Types of LB Implementations in GCP:
Global
This type of LB can distribute traffic across several geographic regions around the world. It allows traffic to be directed to the region closest to the user, reducing latency and improving the experience.
Regional
In this case, it distributes traffic only within a specific geographic region. For example, we can deploy our LB in US-CENTRAL1. And the LB will only be able to interact with services within that region.
Classic
Classic mode is generally associated with first-generation or more traditional Load Balancers, which offer a more basic setup and fewer features compared to more modern options. Although the specific term and its characteristics may vary between cloud providers, generally, classic mode provides connection-level load balancing without advanced content-based routing or application inspection capabilities.
Cross-regional
Unlike Global, this type of LB will only be able to distribute traffic across specific Regions. A cross-regional LB could direct traffic primarily within certain regions while providing the ability to failover to other regions in the event of an outage.
Proxy vs. Proxy PassThrough
Depending on the type of traffic, you have the option to choose between LB Network Proxy or LB PassThrough.
What’s the difference?
Proxy LBs
Client connections terminate at the LB. A new connection is then opened from the LB to the backend. Application LBs and NLB Proxies work this way. They use GFEs or Envoy.
Passthrough LBs
These LBs do not terminate the connections at the LB but forward the packet to the backend without modifying the Source, Destination and port. Connections terminate in the backend and responses from the backend to the client are made from the backend to the client. Without going through the LB. this is called Direct Server Return (DSR).
PLBs should be used when it is necessary to preserve the client’s IP in the packet information.
Premium vs Standard Tier on GCP
- Tier Premium: Traffic travels on a high-quality route from GCP’s Global Backbone. Packets enter and exit through a “Google Edge Peering point” that ensures that the connection will be made as close to the client as possible. All ILBs always use the Premium Tier, just as the ELB L7 Global can only be configured in this tier.
- Tier Standard: Traffic enters and exits the Google network at an interconnection point near the Google Cloud region where the balancer is configured. Not all load balancers can be deployed in Tier Standard.
Demo
To see how to set up an ILB you can follow the Step-by-Step in the following note: Traffic Distribution with GCP’s Internal HTTP Load Balancer
Mateo Di Loreto
Thanks for reading. The learning continues in the next article.


