Load Balancing in Google Compute Engine

Load balancing is an important feature of cloud infrastructure services. With the ability to rapidly launch VMs, it is important to ensure that all the VMs are evenly utilized. Amazon’s Elastic Load Balancer (ELB) is quite popular for its ability to route the traffic across a set of instances. Azure IaaS also has a load balancer for the same purpose. Google Compute Engine’s load balancer is similar to other services with a few additional capabilities.

GCE load balancer can be used in three different scenarios. The first scenario is the classic network load balancing. The second scenario is based on HTTP for regional load balancing and the final scenario is content-based load balancing that is used to serve static content from different sources that are optimized for specific content. Let’s take a closer look at each of these scenarios.

Network Load Balancing in Google Compute Engine

This is the most commonly used load-balancing scheme where a specific port on the load balancer is mapped to a pool of VMs. For example, to load balance the web service, port 80 on the load balancer is mapped to the web servers running in the same region across multiple zones. The pool of VMs participating in the load balancing can be associated with a health check. When a specific web server fails the health check, the load balancer stops routing the traffic to it. This ensures that only healthy web servers get requests. To avoid intrusion, each web server can listen on an obscure port other than 80, which can still be mapped to load balancers port 80.

Cross-region Load Balancing in Google Compute Engine

With this scheme of load balancing, it is possible to set up a geo-routing based load balancing. By deploying VMs running identical services across multiple regions, users can be redirected to the nearest region to avoid network latency. For example, a user visiting from Bangalore (India) will be served from the Asia region while a visitor from Seattle (USA) will be routed to the US-West region. This is different from DNS based routing employed by services like Amazon Route 53. Google uses a combination of a proxy and backend service to determine the destination of the request.

This avoids stale responses that are typically seen in DNS based geo routing. We will discuss the concepts of proxy and backends in the coming articles. This scenario is used in disaster recovery or to achieve increased fault tolerance.

Cross-region Load Balancing in Google Compute Engine

Content-based Load Balancing in Google Compute Engine

Some workloads deal with a lot of static content that needs to be separated from the dynamic web server to avoid the contention. It is common to see an Apache server as a front end for WebSphere or JBoss servers just to deal with the static content. But to balance the load further, administrators may want to set up different servers based on the content type. For example, 3 different web servers to host images, videos and PDFs offer better scalability and availability. GCE offers a mechanism to route the request based on the content type. This is called content-based load balancing. In this scenario, multiple web servers hosting different content types get registered with separate backend services that are responsible for routing the request appropriately.

Content-based Load Balancing in Google Compute Engine

The objective of this article was to introduce various load balancing schemes supported by Google Compute Engine. We will drill down into each of these scenarios in the future posts.

Avatar

Written by

Janakiram MSV

Janakiram MSV heads the Cloud Infrastructure Services at Aditi Technologies. He contributes to cloud related articles on YourStory.com. A former employee of Microsoft and Amazon, Janakiram built a cloud consulting company that recently got acquired by Aditi Technologies. He is an analyst with Gigaom Research contributing to the Cloud related market research and analysis. He can be reached at jani@janakiram.com.


Related Posts

Avatar
Stuart Scott
— July 18, 2019

AWS Fundamentals: Understanding Compute, Storage, Database, Networking & Security

If you are just starting out on your journey toward mastering AWS cloud computing, then your first stop should be to understand the AWS fundamentals. This will enable you to get a solid foundation to then expand your knowledge across the entire AWS service catalog.   It can be both d...

Read more
  • AWS
  • Compute
  • Database
  • fundamentals
  • networking
  • Security
  • Storage
Albert Qian
Albert Qian
— June 19, 2018

Preparing for the Microsoft Azure 70-535 Exam

(Update) The Azure 70-535 exam was retired on December 31, 2018, and it was replaced by the AZ-300 and AZ-301 exams. To prepare for these exams, we recommend the Cloud Academy's AZ-300 Exam Preparation: Technologies for Microsoft Azure Architects and the AZ-301 Exam Preparation: Designi...

Read more
  • Azure
  • Compute
  • Database
  • Security
Avatar
Stuart Scott
— May 8, 2017

Which AWS Compute Service Do I Need?

With the ever increasing and expanding service catalog being developed by the engineers at AWS, it's easy to get confused when it comes to understanding which AWS Compute service you need and which service you should be using for your deployments. Which service offers me the quickest de...

Read more
  • AWS
  • Compute
  • Lightsail
Avatar
Sudhi Seshachala
— February 21, 2017

Which Cloud Computing Platform? Advantages of a Multi-Cloud Strategy

The rivalry is warming up in the cloud space as vendors continue to offer innovative features and reduced pricing. In this post, we will highlight the competition between the three titans of the cloud: Google Cloud Platform (GCP), Amazon Web Services (AWS), and Microsoft’s Azure. Which ...

Read more
  • AWS
  • Azure
  • Compute
  • Google Cloud Platform
Avatar
Paul Carlstroem
— May 5, 2016

Compute Fundamentals for AWS: Updated Course

Innovation fuels cloud computing. Compute Fundamentals for AWS: Updated, Improved, and Better than Ever Cloud Academy happily announces a major update to a popular course: Compute Fundamentals for AWS. David Robinson originally built this course an introduction to AWS's cornerstone comp...

Read more
  • AWS
  • Compute
Avatar
David Clinton
— May 19, 2015

Preemptible Virtual Machines: Cheap Instances From Google Compute Engine

Could you use some serious computing power? Say hello to Google's Preemptible Virtual Machines. One of the nice things about having access to hundreds of thousands of computers is that you get to do cool stuff. Arguably, the fact that, with enough creativity, you can use that access to...

Read more
  • Compute
  • Google Cloud Platform
Avatar
Sanket Dangi
— March 24, 2015

EC2 vs Google Compute Engine: Comparing the Big Players in IaaS

IaaS: EC2 vs Google Compute Engine Arguably, Infrastructure as a Service (IaaS) is the most important cloud computing vertical. Within that, in terms of services and features, AWS enjoys the top position, while Google Cloud Platform is slowly catching up. In this post, we'll discuss th...

Read more
  • AWS
  • Compute
  • EC2
  • Google Cloud Platform
Igor Putilov
Igor Putilov
— February 26, 2015

EC2 Pricing: Understanding Compute Costs on AWS

Amazon EC2 pricing considerations (& how to save your money) After a first glance at the Amazon EC2 pricing page, you might find absorbing so much information a little intimidating. In this post, we will try to break EC2 pricing down and provide strategies to not only ease the pain...

Read more
  • AWS
  • Compute
  • EC2
Avatar
Andrea Colangelo
— October 23, 2014

Learn Google Compute Engine – New Course

After the launch of our first course introducing the Google Cloud Platform, David Clinton is back with a brand new course - Launching a GCE instance. We just launched it, and you can watch it on CloudAcademy. Google is one of the hottest cloud platform, probably the most interesting ...

Read more
  • Compute
  • Google Cloud Platform
Avatar
Madan Ganesh Velayudham (ActOnMagic)
— August 8, 2014

Deploying a MEAN Stack Onto Google Compute Engine

Gone are the days where a product team used to spend a considerable amount of time to build a basic web application.  Say Hi to MEAN! If you are familiar with LAMP/WAMP stacks, you could consider MEAN as a complete stack based on JavaScript. In fact, MEAN represents MongoDB,  Express, A...

Read more
  • Azure
  • Compute
Avatar
Praveen Kumar Muppala
— July 21, 2014

How Identity and Access Management Works in Google Compute Engine

Google Cloud Platform is gaining momentum, and it seems that Google is warming up to compete with Amazon Web Services. During the last quarter, Google has invested heavily on new services and features for both Google App Engine and Google Compute Engine. Like any other cloud computing p...

Read more
  • Compute
  • Google Cloud Platform
Avatar
Janakiram MSV
— July 4, 2014

Overview of Replica Pools in Google Compute Engine

Cloud is all about elasticity. Cloud infrastructure running web-scale applications can shrink and grow dynamically. Batch processing on the cloud will have to deal with on-demand instantiation of the machines based on the load. Google Compute Engine is a high performance, next-genera...

Read more
  • Compute
  • Google Cloud Platform