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?
- Deploy the custom container image directly to Cloud Run and set the concurrency configuration parameter to handle multiple requests per instance.Cevap
- BDeploy 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.
- CDeploy the container image to Compute Engine using an Unmanaged Instance Group behind an External HTTP(S) Load Balancer to enable custom concurrency handling.
- DRefactor 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
Anahtar Kavram
Selecting Cloud Run vs Cloud Functions based on containerization, concurrency, and trigger requirements.