Question

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

A digital media engineering team is planning the serverless compute architecture for a new video processing microservice on Google Cloud. The workload relies on a custom-compiled C++ binary with specific Linux OS-level dynamic libraries. Individual processing requests take up to 40 minutes to finish, and to maintain cost efficiency, each deployed instance must process up to 8 concurrent requests simultaneously. Which serverless compute option should the team select to meet these technical requirements?

  1. Deploy the application to Cloud Run using a custom container image that packages the binary and OS dependencies, setting the request timeout to 40 minutes and container concurrency to 8.Answer
  2. B
    Deploy the application to Cloud Functions (1st gen) by embedding the C++ binary into a Python runtime package, configuring the function timeout to 40 minutes.
  3. C
    Deploy the application to Cloud Functions (2nd gen) using an Eventarc trigger, relying on standard language buildpacks without container customization.
  4. D
    Deploy the application to Compute Engine using an unmanaged Instance Group with CPU-based autoscaling rules.

Answer

Deploy the application to Cloud Run using a custom container image that packages the binary and OS dependencies, setting the request timeout to 40 minutes and container concurrency to 8.
Cloud Run is the optimal serverless platform for containerized applications requiring custom system dependencies (like C++ binaries and Linux libraries), long request timeouts (up to 60 minutes for HTTP requests), and configurable multi-concurrency per instance.

Step-by-Step Solution

1
Analyze runtime and dependency constraints
The requirement specifies a custom-compiled C++ binary requiring specific OS-level dynamic libraries. Cloud Run allows arbitrary Docker container images, whereas standard serverless functions are constrained by standard language runtime buildpacks.
Containerization is required when custom binaries or system-level dependencies are present.
2
Evaluate execution timeout requirements
The workload requires a 40-minute execution timeout. Cloud Run supports HTTP request execution timeouts up to 60 minutes, whereas Cloud Functions (1st gen) caps HTTP timeouts at 9 minutes.
Long-running serverless request processing demands platforms supporting extended timeouts.
3
Evaluate concurrency requirements
Cloud Run allows configuring container concurrency so a single container instance can handle multiple requests (e.g., 8 requests) concurrently, optimizing resource utilization and cost.
Cloud Run provides explicit container concurrency controls.

Key Concept

Selecting Cloud Run versus Cloud Functions based on container customization, execution timeout limits, and concurrency settings
Estimated Time:2m 0s
Rate this question