Your Cloud Function processes images uploaded to Cloud Storage. It intermittently times out on large files. The function is configured with 60s timeout and 256MB memory. What is the most effective fix?

Direct Answer (Verified)Reviewed by Sunny (Senior Cloud Engineer)

Correct Answer: Increase the function timeout to 540s and scale memory to 1GB or 2GB to handle large payloads within the single invocation

Cloud Functions (2nd gen) support up to 60 minutes timeout and 32GB RAM. For large file processing, increasing timeout (up to 540s for 1st gen, 3600s for 2nd gen) and memory alloca...

๐Ÿ“‹Part of Professional Cloud Architect ยท GCP Certification Practice
Real Exam Scenario

Your Cloud Function processes images uploaded to Cloud Storage. It intermittently times out on large files. The function is configured with 60s timeout and 256MB memory. What is the most effective fix?

โœ“ Correct Answer & Explanation

Correct Answer

Increase the function timeout to 540s and scale memory to 1GB or 2GB to handle large payloads within the single invocation

Why This Answer Is Correct

Cloud Functions (2nd gen) support up to 60 minutes timeout and 32GB RAM. For large file processing, increasing timeout (up to 540s for 1st gen, 3600s for 2nd gen) and memory allocation is the simplest fix if the workload fits within one invocation. Cloud Run is better for complex, long-running or containerized workloads. Cloud Tasks adds asynchronous processing but increases complexity โ€” better when you need reliable retry logic across distributed workloads.