Question

Difficulty: EasyManaging Cloud Run Resources

A cloud engineer wants to ensure that an existing Cloud Run service named `payments-api` always keeps a minimum of 3 container instances ready to serve incoming traffic to avoid cold start latencies. Which `gcloud` command should the engineer execute?

  1. gcloud run services update payments-api --min-instances 3Answer
  2. B
    gcloud run services update payments-api --max-instances 3
  3. C
    gcloud functions deploy payments-api --min-instances 3
  4. D
    gcloud run services update-traffic payments-api --to-revisions=LATEST=3

Answer

The command 'gcloud run services update payments-api --min-instances 3' correctly configures the service to keep 3 warm instances active.
Executing 'gcloud run services update payments-api --min-instances 3' updates the Cloud Run service configuration so that at least 3 instances remain provisioned and warm, mitigating cold start latency.

Step-by-Step Solution

1
Identify the target resource and operation
The target is an existing Cloud Run service named `payments-api`, and the goal is to set a lower bound for instance scaling.
Setting minimum instances ensures container instances remain warm and ready to receive requests without cold start delays.
2
Determine the correct gcloud command and flag
Use 'gcloud run services update payments-api' with the '--min-instances 3' flag.
The '--min-instances' flag explicitly controls the minimum number of container instances provisioned for a Cloud Run service.

Key Concept

Cloud Run Instance Provisioning and Minimum Instances
Estimated Time:45s
Rate this question