Intrigued by the art of cloud architecture? Discover how to design, develop, and manage robust, secure, scalable, and dynamic solutions on Google Cloud as you prepare for the Professional Cloud Architect exam!
Performance and latency are critical considerations when designing cloud architectures on Google Cloud. Latency refers to the delay in data transfer between users and cloud services, and minimizing this delay directly improves the user experience. Architects must evaluate network configurations, compute resources, and monitoring tools to ensure applications respond quickly while remaining cost-effective. The following sections cover the key areas that architects need to understand to optimize performance and reduce latency in GCP environments.
Google Cloud offers two main options for routing traffic: Premium Tier and Standard Tier. Premium Tier uses Google's global backbone network to carry traffic as close to the user as possible, which significantly lowers latency. Standard Tier routes traffic over the public internet, making it a cost-effective choice for regional needs. Architects must select Premium Tier for global load balancing and applications that require the highest performance and reliability.
A Global External Application Load Balancer uses Google Front Ends (GFEs) to improve performance at the edge of the network. These GFEs perform TCP termination close to the user, which reduces the time spent on the initial connection handshake. By maintaining persistent connections to backends, GFEs minimize the impact of physical distance on application responsiveness. This architecture allows users to connect to a local entry point rather than traveling across the globe to a distant data center.
Cloud CDN works with global load balancers to cache content at Points of Presence (PoPs) located around the world. This service reduces the Time to First Byte (TTFB) by serving data from a location physically near the user. When a cache hit occurs, the request does not need to travel all the way to the origin server. The benefits include reduced latency, lower origin load, and improved reliability even when the origin is under heavy load.
While global load balancers optimize for speed, an External Passthrough Network Load Balancer operates at the regional level. It uses Direct Server Return (DSR), where the load balancer sends traffic to the backend, but the backend responds directly to the client. This type of load balancer is ideal for preserving the original client IP address or handling non-HTTP traffic like UDP. Architects should evaluate whether a proxy-based or passthrough approach better suits their specific technical and latency requirements.
Choosing the right machine type is essential for balancing cost and performance in a cloud environment. For database workloads like MySQL, using highmem instances provides a high ratio of RAM to vCPU, which helps keep data in the buffer pool for faster access. Selecting the correct VM size ensures that the working set fits into memory, which significantly reduces the need for slow disk reads and improves overall speed.
Google Cloud Hyperdisk is the next generation of block storage designed for high-performance needs. Hyperdisk Balanced allows users to select IOPS and throughput independently from the disk size, providing great flexibility for different workloads. This separation allows you to pay only for the performance your application requires while maintaining high durability and low latency.
Architects must choose between different deployment patterns to optimize global performance and minimize delays. A distributed frontend with a single backend can reduce latency for web requests while keeping data management simple and consistent. For the lowest possible latency, distributing both the frontend and backend across multiple regions allows requests to be handled entirely within the user's local area.
Understanding the relationship between throughput and resource exhaustion is key to identifying system bottlenecks. Performance often levels off when a system reaches its limits, such as CPU exhaustion on the database server or network bandwidth bottlenecks between services. Monitoring the inverse relationship between latency and throughput helps architects determine exactly when to scale their infrastructure to maintain a high-quality user experience.
Performance monitoring is essential for ensuring that cloud applications run smoothly and meet user expectations. Architects often use load testing to create a graph that compares throughput—the amount of data processed—against latency, which is the time it takes to complete a request. By analyzing these results, you can identify the ideal balance between cost and speed for your specific workload. This experimental approach helps in setting accurate targets for automated scaling.
When users experience slow page interactions, you can use browser-based tools to diagnose the problem. Tools like Chrome DevTools and Safari Web Inspector allow you to record a performance profile or capture a HAR file to track network activity. These recordings help developers see exactly where delays occur during page rendering or data fetching. Once the issue is captured, the file can be shared with support teams for deeper analysis.
Within Google Cloud, Cloud Monitoring provides deep visibility into system health using tools like PromQL to query specific data. For specialized tasks like machine learning, you can track metrics such as KV-cache utilization or GPU cache usage. Monitoring these metrics allows you to make data-driven adjustments to your infrastructure based on real-time traffic. This ensures that resources are used efficiently while maintaining high performance.
To maintain performance during traffic spikes, the Horizontal Pod Autoscaler (HPA) can automatically add more resources. You must choose the right scaling metric based on your specific performance goals. The num_requests_waiting metric is best for optimizing throughput and cost, while gpu_cache_usage_perc is best for latency-sensitive workloads where speed is the priority. Selecting the correct metric ensures that your application scales quickly enough to prevent bottlenecks.
Another way to minimize latency is by configuring TLS Early Data (0-RTT) on your load balancer. This concept allows a client to send data before the security handshake is fully finished, speeding up the connection. There are several modes to manage this safely. STRICT mode only allows safe, simple requests without query parameters. PERMISSIVE mode allows more flexibility but requires the owner to ensure it is safe. DISABLED mode turns the feature off to prevent security risks. Implementing 0-RTT can significantly reduce the time it takes to establish a connection for global users, though administrators must be careful to avoid replay attacks on non-idempotent requests.
Prepare and test your skills
Prepare and test your skills
Premium Tier uses Google's global backbone network to carry traffic close to the user, which lowers latency, while Standard Tier routes traffic over the public internet for cost-effective regional needs. Architects must select Premium Tier for global load balancing and applications requiring the highest performance and reliability.
Cloud CDN works with global load balancers to cache content at Points of Presence (PoPs) located around the world, reducing the Time to First Byte (TTFB) by serving data from a location near the user. This reduces latency, lowers origin load, and improves reliability even when the origin is under heavy load.
An External Passthrough Network Load Balancer operates at the regional level and is ideal for preserving the original client IP address or handling non-HTTP traffic like UDP. Architects should evaluate whether this passthrough approach better suits their specific technical and latency requirements compared to a proxy-based global load balancer.
TLS Early Data (0-RTT) is a configuration on a load balancer that allows a client to send data before the security handshake is fully finished, speeding up the connection. Implementing 0-RTT can significantly reduce connection time for global users, though administrators must be careful to avoid replay attacks on non-idempotent requests.
An enterprise is migrating a high-traffic MySQL database workload to Compute Engine on Google Cloud. An analysis of the database workload reveals the following requirements:
Which Compute Engine VM and block storage architecture should you configure to meet these performance and cost requirements?
Deploy a high-CPU (highcpu) machine type with Tier_1 networking enabled, and use attached Local SSDs configured as database swap space.
Deploy a standard (standard) machine type with Hyperdisk Extreme provisioned to maximum IOPS to serve read operations directly from persistent storage.
Deploy a compute-optimized (c2) machine type with standard Persistent Disk (pd-standard), and configure read replicas to distribute query throughput.
Deploy a high-memory (highmem) machine type that accommodates the working set within the database buffer pool, and attach a Google Cloud Hyperdisk Balanced volume provisioned for the write workload.