Question

Difficulty: MediumPlanning Serverless Compute Options (Cloud Run and Cloud Functions)

An organization is planning to deploy a stateless HTTP microservice to Google Cloud. The application requires a custom system library compiled into a custom Linux container image and must handle up to 80 concurrent HTTP requests per container instance to optimize resource utilization and reduce cost during peak load. Which Google Cloud serverless compute option should you select to fulfill these architectural requirements?

  1. Deploy the custom container image to Cloud Run and configure the concurrency setting to 80.Answer
  2. B
    Deploy the workload as a 1st gen Cloud Functions HTTP trigger, specifying a custom container image in the deployment configuration.
  3. C
    Deploy the workload to Compute Engine using a Managed Instance Group composed exclusively of Spot VMs behind a Load Balancer.
  4. D
    Deploy the code to App Engine Flexible environment and hardcode the container port to listen on port 80 instead of reading environment variables.

Answer

Deploying the custom container image to Cloud Run while configuring maximum concurrency to 80 meets all requirements for custom binary container support and concurrent request handling.
Cloud Run is designed to execute stateless container images invoked via HTTP requests. It allows developers to deploy arbitrary container images containing custom system dependencies and supports serving multiple concurrent requests (up to 1000 per instance, default 80) on a single container instance.

Step-by-Step Solution

1
Analyze containerization and runtime requirements
The application requires a custom system library packaged into a custom Linux container image.
Cloud Run supports any custom container image listening on the HTTP PORT environment variable.
2
Evaluate concurrency requirements
The workload requires processing up to 80 concurrent HTTP requests per container instance.
Cloud Run allows configuring concurrency (up to 1000 requests per instance), enabling cost optimization and high throughput per instance.
3
Select the optimal serverless option
Cloud Run provides serverless container execution with multi-concurrency support out of the box.
Cloud Functions (1st gen) is limited to single-request concurrency per instance and standard language runtimes.

Key Concept

Cloud Run Concurrency and Custom Container Support
Estimated Time:1m 30s
Rate this question