This project is used to demonstrate the scaling improvements on the AWS Lambda SQS Event-source mapping.
Read the full announcement blog here.
![]()
This sample project is configured to demonstrate a large scale workload processing 200,000 messages. Running the project might incur charges to your account.
-
Install the AWS CLI and configure it with access permissions the region of your choice. Follow the instructions here.
-
Install the AWS CDK. Follow the instructions here.
-
Install Node.js. Follow the instructions here.
-
Clone this repository. Open the cloned directory
git clone https://github.com/aws-samples/lambda-sqs-event-source-mapping-scaling-improvements.git cd lambda-sqs-event-source-mapping-scaling-improvements
-
Deploy the CDK Stack
cdk deploy
Take a note of the
sqs-esm-improvements.QueueUrl
output you'll receive after successful completion. -
Open the
/sqs-canon
directory. It contains a simple app that will populate your SQS queue with 200,000 messages. Update line 7 inindex.mjs
with the value ofsqs-esm-improvements.QueueUrl
you obtained in the previous step. -
Run the
sqs-cannon
. Confirm messages are being sent to the SQS queue.node index.js
-
Navigate to CloudWatch Dashboards, and open a newly created dashboard that starts with
LambdaSqsEsmScalingDemoDashboard
. Watch the Lambda function gradually scaling up as SQS queue is being drained.
Use the cdk destroy
command to delete the sample application stack
cdk destroy
For more serverless learning resources, visit Serverless Land