DOP-C02 Incident and Event Response Practice Question
A company has a serverless application using AWS Lambda functions and Amazon API Gateway. The application has been running fine, but recently users report that some requests are timing out with a 504 error. The Lambda function's timeout is set to 30 seconds, and API Gateway's integration timeout is 29 seconds. The CloudWatch logs for the Lambda function show that the function executes in under 5 seconds on average. What is the MOST likely cause of the 504 errors?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The Lambda function is experiencing concurrency limits and requests are being throttled.
Even though the Lambda function runs in under 5 seconds, if it is throttled due to concurrency limits, the function may not be invoked until after API Gateway's 29-second integration timeout has passed. This causes API Gateway to return a 504 error. Option A is incorrect because excessive logging does not cause 504 errors; it may affect performance but not directly cause timeouts. Option B is incorrect because the Lambda timeout (30s) is actually higher than API Gateway's integration timeout (29s), so the function could complete before API Gateway times out. Option D is incorrect because cold starts typically add only a second or two, not enough to exceed the 29-second integration timeout when average execution is under 5 seconds.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The Lambda function is logging too much data, causing delays in log delivery.
Why it's wrong here
CloudWatch Logs ingestion is an asynchronous side effect of a Lambda invocation; the Lambda runtime sends log events to CloudWatch through a separate control-plane path that does not block the function's response. Even if the function floods CloudWatch with large log streams, the additional CPU overhead is rarely significant enough to push a 5-second function past API Gateway's 29-second integration timeout, and a 504 specifically indicates the backend did not respond in time, not that its logs were delivered slowly. Excessive logging therefore cannot cause the observed 504 error.
- ✗
API Gateway's timeout is set to less than the Lambda function's timeout.
Why it's wrong here
API Gateway has a hard 29-second integration timeout for synchronous requests, which is intentionally set just below Lambda's 30-second execution limit so that API Gateway can always return an error before the Lambda function itself times out. In this scenario the function completes in about 5 seconds, leaving roughly 24 seconds of slack before either timeout triggers. A timeout mismatch alone could never cause a 504 when the actual execution time is far below both limits, so this is not the root cause.
- ✓
The Lambda function is experiencing concurrency limits and requests are being throttled.
Why this is correct
When the Lambda function's concurrency limit is reached, synchronous invocations from API Gateway are throttled. For proxy integrations, a throttled request is not immediately rejected—the Lambda service may wait for a free concurrency slot while API Gateway's 29-second integration timeout is already counting down; if no slot frees up in time, API Gateway drops the connection and returns a 504. This explains intermittent 504s even though a 5-second function would otherwise succeed, because the delay occurs before the function code ever runs.
- ✗
The Lambda function's memory is too low, causing cold starts to take longer than the timeout.
Why it's wrong here
The amount of memory allocated to a Lambda function directly controls its CPU speed and mitigates the cold-start latency, but even a short cold start lasts only milliseconds to low seconds, nowhere near the 29-second gateway timeout. If memory were truly too low, the function would immediately fail with a MemoryExceeded exception or consistently slow down all invocations, not sporadically time out after 5 seconds. Given the function's measured 5-second execution time, low memory and cold starts are effectively eliminated as potential causes.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
About these practice questions
This DOP-C02 question is part of Courseiva's 1,298-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.