Soru

Zorluk: ZorManaging Cloud Run Resources

An operations team needs to adjust execution limits for a production Cloud Run service named `inventory-api` running in the `us-central1` region to prevent connection starvation on a backend database. The service must be constrained to handle a maximum of 80 concurrent requests per container instance and cap overall scaling at 20 concurrent container instances, while still allowing the service to scale down to zero when idle. Which `gcloud` command correctly configures these operational limits?

  1. gcloud run services update inventory-api --concurrency=80 --max-instances=20 --region=us-central1Cevap
  2. B
    gcloud functions deploy inventory-api --concurrency=80 --max-instances=20 --region=us-central1
  3. C
    gcloud run services update inventory-api --max-concurrency=80 --max-replicas=20 --region=us-central1
  4. D
    gcloud run services update inventory-api --concurrency=80 --min-instances=20 --region=us-central1

Cevap

The command 'gcloud run services update inventory-api --concurrency=80 --max-instances=20 --region=us-central1' correctly updates the service configuration.
The correct command uses 'gcloud run services update' with the '--concurrency=80' flag to restrict simultaneous requests per container and '--max-instances=20' to prevent autoscaling beyond 20 total container instances.

Adım Adım Çözüm

1
Identify the proper Google Cloud CLI target binary for Cloud Run resource management.
Selected 'gcloud run services update' as the correct management command for existing services.
Cloud Run service management requires 'gcloud run services', whereas 'gcloud functions' manages Cloud Functions.
2
Identify the correct flag for limiting per-instance request concurrency.
Determined that '--concurrency=80' sets max requests per container instance.
The '--concurrency' flag defines how many simultaneous requests a single container instance can receive.
3
Identify the correct flag for setting upper bounds on instance scaling.
Determined that '--max-instances=20' caps total instances while retaining default min-instances behavior of zero.
Using '--max-instances' caps maximum scaling to protect backend resources, while '--min-instances' specifies baseline capacity.

Anahtar Kavram

Cloud Run Autoscaling and Concurrency Configuration
Tahmini Süre:2m 0s
Bu soruyu puanla