Serverless Load Generator using Distributed Map

This example creates a serverless load generator using AWS Step Functions to load an AWS Lambda function. It can also be extended to load test other workloads like HTTP endpoints, APIs, or other services that AWS Step Functions support.

When the Step Function is triggered, it first starts the ramp-up phase. In this phase, it starts a timer to monitor if the ramp-up time is reached. It then uses a distributed map to call the Lambda function in parallel. After each execution of the distributed map ends, the Step Function checks if the ramp-up time is reached and increases the concurrency of the distributed map. Once the ramp-up time is reached, the state machine then sends the load to the Lambda for the time specified in input.

< Back to all workflows

GitHub icon View this workflow on GitHub


Clone repo

git clone https://github.com/aws-samples/step-functions-workflows-collection/tree/main/step-functions-load-testing/cd step-functions-workflows-collection/step-functions-load-testing

Deploy

sam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: sam delete.

Additional resources

Created by:

Rakshith Rao

Rakshith Rao

I am a Senior Solutions Architect at AWS and help our strategic customers build and operate their key workloads on AWS.

Follow on LinkedIn

Biswanath Mukherjee

Biswanath Mukherjee

Sr. Solutions Architect working at AWS India.

Follow on LinkedIn