0
0
GCPcloud~30 mins

Performance optimization in GCP - Mini Project: Build & Apply

Choose your learning style9 modes available
Performance Optimization in Google Cloud Platform
📖 Scenario: You are managing a web application hosted on Google Cloud Platform (GCP). The application is experiencing slow response times during peak hours. To improve user experience, you want to optimize the performance by configuring autoscaling and load balancing.
🎯 Goal: Build a simple Google Cloud configuration that sets up an instance group with autoscaling enabled and a load balancer to distribute traffic evenly.
📋 What You'll Learn
Create a managed instance group with 3 instances
Set autoscaling to increase instances when CPU usage exceeds 60%
Configure a load balancer to distribute traffic to the instance group
💡 Why This Matters
🌍 Real World
Web applications often face varying traffic loads. Autoscaling and load balancing help maintain fast response times and availability during traffic spikes.
💼 Career
Cloud engineers and DevOps professionals use these configurations daily to optimize cloud infrastructure performance and cost.
Progress0 / 4 steps
1
Create a managed instance group
Create a managed instance group called web-instance-group with 3 instances using the template web-instance-template.
GCP
Need a hint?

Use the google_compute_instance_group_manager resource with target_size = 3.

2
Add autoscaling configuration
Add an autoscaler called web-autoscaler for the instance group web-instance-group that increases instances when CPU utilization exceeds 0.6 (60%).
GCP
Need a hint?

Use the google_compute_autoscaler resource linked to the instance group with cpu_utilization.target = 0.6.

3
Configure a load balancer backend service
Create a backend service called web-backend-service that uses the instance group web-instance-group as its backend.
GCP
Need a hint?

Use google_compute_backend_service with the instance group as backend.

4
Create a HTTP load balancer frontend
Create a global forwarding rule called web-forwarding-rule that listens on port 80 and forwards traffic to the backend service web-backend-service.
GCP
Need a hint?

Use google_compute_global_forwarding_rule with port_range = "80" and target the backend service.