SAP-C02 Question 653
Single answerYour company is deploying a serverless web application using AWS Lambda and Amazon API Gateway. The application needs to process high volumes of incoming requests during peak hours and must maintain low latency. After deployment, you notice that during peak traffic, some requests are failing with a '429 Too Many Requests' error. How can you resolve this issue while adhering to a serverless architecture?
- A
Increase the reserved concurrency limit for the Lambda function.
- B
Enable API Gateway's throttling limits to reduce the incoming request rate.
- C
Configure AWS Lambda with provisioned concurrency.
- D
Use AWS Step Functions to queue incoming requests and process them asynchronously.
Show answer and explanation
Correct answer: C
Explanation
The '429 Too Many Requests' error indicates that the Lambda function is being throttled due to insufficient concurrency. By configuring provisioned concurrency, you can ensure that a specific number of Lambda function instances are pre-warmed and ready to handle incoming requests, thus avoiding throttling and maintaining low latency during peak traffic.
- A. Incorrect.
Increasing the reserved concurrency limit for the Lambda function might help in avoiding throttling, but it doesn't directly address the '429 Too Many Requests' issue which is likely caused by the lack of provisioned concurrency during peak traffic.
- B. Incorrect.
Enabling API Gateway's throttling limits would only reduce the number of incoming requests, but it does not solve the issue of handling high traffic while maintaining low latency.
- C. Correct.
Configuring AWS Lambda with provisioned concurrency ensures that a specific number of function instances are always ready to process requests, which eliminates cold starts and handles high traffic with low latency, resolving the issue effectively.
- D. Incorrect.
Using AWS Step Functions to queue incoming requests and process them asynchronously is not suitable for this scenario because the application requires low latency and synchronous request processing.