A developer is configuring an AWS Lambda function to process a real-time data stream from Amazon Kinesis. During testing under high load, the Lambda function frequently times out because it cannot process the large batch of stream records within its configured execution time limit. Which action should the developer take to resolve this processing timeout issue?
- Decrease the batch size (BatchSize) in the Lambda event source mapping configuration.Cevap
- BChange the partition key on the producer to a single static string to consolidate all records into one shard.
- CMove the Lambda function into a private VPC subnet with no NAT Gateway to decrease network latency.
- DModify the trust policy of the Lambda execution role to allow the Kinesis service to assume the role.
Cevap
Decrease the batch size (BatchSize) in the Lambda event source mapping configuration.
Decreasing the batch size in the event source mapping limits the number of stream records sent to the Lambda function during a single invocation. This directly reduces the computational load and time required to execute the function, preventing it from hitting the execution time limit.
Adım Adım Çözüm
Anahtar Kavram
Configuring Kinesis event source mapping parameters for AWS Lambda to optimize stream processing.
Tahmini Süre:1m 0s