Load Balancing Blitz — Introduction

Maddula Sampath Kumar
Google Cloud - Community
4 min readJun 14, 2024

Join me on a 5 part learning series, where we explore load balancing on Google Cloud. In this series, we will learn about a fun game and a live demo we have created for Google NEXT ’24 called Load Balancing Blitz.

What is Load Balancing Blitz?

Load Balancing Blitz is a web-based application that mimics real-world scenarios using a game-like interface. It employs real-time traffic flow simulations to deliver a game experience.

In this game, users will engage in a competition with a real Google Cloud Load Balancer. The objective is to distribute incoming web traffic effectively among available Compute VMs while maintaining a well-balanced load on each VM. This process involves understanding the real time network latencies and intelligently routing traffic to ensure optimal resource utilisation.

Explain me with more technical details ?

Let start with a flow chart

At the game’s start, two web (HTTP) traffic generators with identical configurations generate traffic, as illustrated in the flow chart. As the game progresses, traffic flow intensifies.

The first traffic generator sends all its traffic to the Google Cloud Load Balancer (GCLB), while the second sends it to the Player Controller Application. GCLB manages its own traffic, while Player Controller Apps organise and direct it based on player instructions.

Worker machines process all web traffic and take a fixed amount of time to process each request. Each worker machine processes jobs in parallel while maintaining a buffer queue to accept and store additional jobs. If the buffer overflows, the request is recorded as an uncompleted job.

During the game, the player’s objective is to direct traffic to the Worker machines to avoid overflowing their queue capacity.

For each request completed within the game’s time limit, the player or GCLB receives one point. Requests that are still overflowing or in the queue when the game ends yield zero points.

How do you play this Game?

The Game UI is hosted in Cloud Run and here is a quick recording of the game of an actual game, with instructions.

Load Balancing Blitz is a 60 seconds game and players are provided with the physical pedals presented below. As the game starts, the traffic starts flowing to the available 4 worker machines. By default traffic flows to the 1st machine. As the traffic increases, the player has to send traffic to a different worker machine. To select between 4 worker machines, the player has to press 1, 2, 3 or 4 buttons as shown below.

Similar to the player, GCLB will do the load distribution work live.

What are the challenging parts of the game?

Load Balancing Blitz is a real-time game, where players can switch between 1 to 4 workers during gameplay. This requires the transfer of information from the player’s frontend to the application server and eventually to the backend, where player controller inputs are registered. Upon request registration, the player backend controller application initiates the direction of traffic to the selected worker. Due to the involvement of multiple network hops, network latency(90~150ms) becomes a tangible factor that players may experience during gameplay.

Another significant lesson from the game is that a single Compute VM has limited capacity, and distributing the workload effectively manages web traffic. This teaches players to optimise resource allocation efficiently, resulting in higher scores.

How does the scoreboard look like? How do you measure user performance% ?

While engaging in the gameplay, real-time web traffic is incorporated, and the scores are susceptible to network latency. To mitigate this challenge, we evaluate user performance by comparing it to the Global Cloud Load Balancer (GCLB) as a percentage.

How was the response at Cloud Next 24?

Load Balancing Blitz game was available for everyone who attended at Cloud Next 2024 event. During those 3 days at the Las Vegas Nevada, we recorded 280+ games. Each game has a 5 seconds start time and a 60 seconds game, this amounts to 5 hr of pure game time. With other inclusions of queries and feedback, we had 12~15 hrs of fun successful event.

To learn more about load balancing on Google Cloud check out the following:

Stay tuned for the upcoming posts where we explore Architecture, Backend, Frontend and Data pipelines.

--

--

Maddula Sampath Kumar
Google Cloud - Community

Software Developer - Developer Relations in Google Cloud, Poland. To more about me, check https://www.linkedin.com/in/msampathkumar/