Soru

Zorluk: Çok zorPlanning Serverless Compute Options (Cloud Run and Cloud Functions)

An enterprise developer needs to migrate a legacy web service to a Google Cloud serverless platform. The application is packaged as a custom Docker container image containing compiled C++ binaries and system-level C libraries. The service handles HTTP requests that can each take up to 45 minutes to process. To optimize cost efficiency during peak traffic, each deployed compute instance must handle up to 80 concurrent HTTP requests simultaneously, while scaling down completely to zero instances during idle periods with zero underlying server maintenance. Which Google Cloud compute solution best satisfies these architectural requirements?

  1. Deploy the containerized application to Cloud Run, configuring instance concurrency to 80 and setting the HTTP request timeout to 45 minutes.Cevap
  2. B
    Deploy the application code to Cloud Functions (1st gen) with an HTTP trigger, enabling multi-request concurrency and setting the function execution timeout to 45 minutes.
  3. C
    Deploy the application to Cloud Functions (2nd gen) by packaging the compiled C++ binary into a ZIP archive wrapper with a Node.js runtime script.
  4. D
    Deploy the containerized workload to Compute Engine Managed Instance Groups (MIGs) with an HTTP(S) Load Balancer and autoscaling policy set to scale to zero instances.

Cevap

Deploy the containerized application to Cloud Run, configuring instance concurrency to 80 and setting the HTTP request timeout to 45 minutes.
Deploying the containerized application to Cloud Run satisfies all constraints. Cloud Run allows running arbitrary container images with custom C++ binaries, supports setting HTTP request execution timeouts up to 60 minutes (exceeding the required 45 minutes), allows configuring instance concurrency to handle multiple requests (80) per container instance, scales down to zero when no traffic arrives, and eliminates infrastructure management overhead.

Adım Adım Çözüm

1
Evaluate runtime container requirements
The application requires custom C++ binaries and system dependencies, which necessitates an arbitrary container image execution environment.
Cloud Run is designed to run any standard container image (OCI-compliant), providing full control over binaries, OS libraries, and runtime environment.
2
Evaluate execution time constraints
The workload requires a request timeout of up to 45 minutes.
Cloud Run supports HTTP request timeouts up to 60 minutes (3600 seconds), whereas Cloud Functions 1st gen maxes out at 9 minutes.
3
Evaluate concurrency and scaling requirements
Each instance must process up to 80 requests simultaneously and scale to zero when idle.
Cloud Run supports multi-concurrency (up to 1000 concurrent requests per container instance) and automatically scales instances down to zero when traffic stops.

Anahtar Kavram

Selecting Cloud Run versus Cloud Functions based on containerization, concurrency, and request execution timeout requirements.
Bu soruyu puanla