Soru

Zorluk: ZorPlanning Serverless Compute Options (Cloud Run and Cloud Functions)

A financial company is planning to migrate a stateless API backend written in Go to Google Cloud. The service must handle incoming REST HTTP requests, scale to zero during off-peak hours to minimize costs, and process up to 250 concurrent requests per container instance to reduce cold starts and optimize memory utilization. The engineering team has already packaged the application into a custom OCI/Docker container image that listens on the PORT environment variable. Which serverless compute option best satisfies these requirements with the lowest operational overhead?

  1. Deploy the custom container image directly to Cloud Run and set the concurrency configuration parameter to handle multiple requests per instance.Cevap
  2. B
    Deploy the application code to Cloud Functions 1st Gen with an HTTP trigger, because 1st Gen functions support custom container images and concurrent request handling by default.
  3. C
    Deploy the container image to Compute Engine using an Unmanaged Instance Group behind an External HTTP(S) Load Balancer to enable custom concurrency handling.
  4. D
    Refactor the containerized Go application into a standard Cloud Functions 2nd Gen event handler triggered by Cloud Pub/Sub, as HTTP traffic cannot be served by Cloud Functions.

Cevap

Deploying the custom container image to Cloud Run and configuring the concurrency setting is the correct choice.
Cloud Run is designed specifically to run stateless containerized applications that listen for HTTP requests. It supports configuring concurrency (allowing up to 1000 concurrent requests per instance, fitting the 250 request requirement), scales automatically from zero to thousands of instances, and eliminates server management overhead.

Adım Adım Çözüm

1
Analyze deployment artifact and runtime requirements
The application is packaged as a custom Docker container image, requires handling HTTP REST traffic, must scale to zero, and needs multi-concurrency (processing up to 250 requests per instance).
Cloud Run natively deploys stateless container images listening on HTTP ports and natively supports request multi-concurrency per container instance.
2
Evaluate serverless compute options against requirements
Cloud Run fits all criteria natively without code refactoring or infrastructure provisioning.
Cloud Functions 1st Gen processes only a single request per instance concurrently and does not deploy custom arbitrary containers.

Anahtar Kavram

Selecting Cloud Run vs Cloud Functions based on containerization, concurrency, and trigger requirements.
Bu soruyu puanla