Courseiva
hardMultiple ChoiceObjective-mapped

Configure Autoscaling and GPU for Traffic Spikes

You are an ML engineer at a global e-commerce company. Your team has developed a deep learning model for product recommendation that runs on Vertex AI Prediction. The model is deployed on a single n1-highmem-2 instance (CPU only) with autoscaling enabled (min replicas=1, max replicas=10). During Black Friday, traffic spikes to 1000 requests per second (QPS), and you observe that latency increases from 50ms to over 5000ms, and many requests time out. You check the monitoring dashboard and see that CPU utilization is at 100% on the single instance, and autoscaling is not triggering quickly enough. The team has a budget for this service and wants to handle the spike without compromising latency. What should you do?

Quick Answer

The correct answer is to switch to GPU instances like n1-standard-4 with T4 and set min replicas=2 with autoscaling up to 10. This solves the traffic spike bottleneck because deep learning inference for product recommendations is compute-intensive and parallelizable; GPUs dramatically reduce per-request latency by offloading matrix operations from the CPU, while raising the minimum replica count ensures warm instances are always available, preventing the cold-start delays that caused autoscaling to trigger too slowly. On the Google Professional Machine Learning Engineer exam, this scenario tests your understanding of Vertex AI Prediction’s autoscaling behavior under sudden load—a common trap is assuming that simply increasing max replicas or raising CPU thresholds will fix latency, when the real issue is the inference hardware itself. Remember the memory tip: “GPU for heavy inference, min replicas for instant defense”—the combination of hardware acceleration and pre-warmed capacity is what handles Black Friday spikes without timeout.

⚠ Common exam trap

Google Cloud often tests the misconception that simply increasing the number of CPU instances or adjusting autoscaling parameters can solve a CPU-bound latency problem, when the real fix is to change the compute architecture (e.g., GPU) to match the workload's computational profile.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Switch to GPU instances (e.g., n1-standard-4 with T4) and set min replicas=2 with autoscaling up to 10

Switching to GPU instances (n1-standard-4 with T4) offloads compute-intensive recommendation model inference to GPUs, significantly reducing per-request latency. Setting min replicas=2 ensures that at least two instances are always warm, reducing cold-start delays and allowing autoscaling to handle traffic spikes more responsively. This combination addresses both the CPU bottleneck and the slow scaling trigger, keeping latency under 50ms even at 1000 QPS.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Switch to GPU instances (e.g., n1-standard-4 with T4) and set min replicas=2 with autoscaling up to 10

    Why this is correct

    GPUs accelerate inference, reducing per-request latency; warm instances handle spike.

  • Increase min replicas to 5 to keep warm instances

    Why it's wrong here

    Without improving per-instance throughput, warm instances may still be insufficient.

  • Set min replicas=1 and max replicas=5 to control cost

    Why it's wrong here

    Limiting max replicas may not handle the spike.

  • Increase max replicas to 20 and keep CPU instances

    Why it's wrong here

    CPU instances have high latency per request; more replicas may not reduce latency enough.

About these practice questions

Courseiva writes every PMLE question from scratch — 990 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

2 more ways this is tested on PMLE

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. You need to serve a TensorFlow model that has a cold start latency of 20 seconds. The model is used for a real-time application with unpredictable traffic, but occasional bursts require immediate responses. What is the best deployment strategy to minimize both cold start impact and cost?

easy
  • A.Set min_replica_count to 1 to keep at least one instance always warm.
  • B.Use a larger machine type to reduce cold start time.
  • C.Set min_replica_count to 0 and rely on autoscaling to handle bursts.
  • D.Enable serving on Cloud Run for faster cold start.

Why A: Setting a minimum number of replicas (min_replica_count) ensures that some instances are always warm, avoiding cold start for the first requests. This balances cost and latency. Prewarming requests or increasing target utilization wouldn't help directly.

Variation 2. A company is serving a model for their e-commerce website. They expect traffic to be low at night and very high during flash sales. They want to minimize costs while ensuring availability during spikes. Which autoscaling configuration should they use?

easy
  • A.min_replica_count=5, max_replica_count=5, target_cpu=60
  • B.min_replica_count=1, max_replica_count=20, target_cpu=60
  • C.min_replica_count=10, max_replica_count=10, target_cpu=60
  • D.min_replica_count=0, max_replica_count=100, target_cpu=80

Why B: Setting a high max_replica_count allows scaling to handle spikes, while a low min_replica_count saves cost during low traffic. CPU utilization target of 60% is reasonable.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This PMLE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PMLE exam.