Shear is an AWS Lambda cost optimization tool designed to help you find the ideal balance between function runtime, memory usage, and cost efficiency. You can provide a Lambda function ARN as input, and Shear will invoke that function with multiple power configurations. It then analyzes the execution logs to suggest the best power configuration to minimize cost and/or maximize performance. It also supports concurrent invocations of the function for enhanced analysis.
Please note that the input function will be executed in your AWS account.
Typical input format:
- Lambda ARN:
arn:aws:lambda:us-west-1:066290895578:function:testFunction
- Lambda Payload:
{"testFunctionParam1":3, "testFunctionParam2":2000, "testFunctionParam3":40}
- Memory Allocation:
- Minimum (MB): 128
- Maximum (MB): 4096
- Memory Intervals: 5
- Test Volume: 25
- Concurrency: True
The expected output is a graph showing the relationship between memory, time, and cost. If concurrency is enabled, an additional graph will be provided, displaying the same data but with fine-tuned power values.
To get started with local development, install dev dependencies with npm install
. To run the server and client concurrently, use npm run all
.
Three deployment options are available:
- Option 1: AWS CloudFormation/HashiCorp Packer
- Option 2: AWS Fargate via ECR
- Option 3: Local
For a detailed deployment breakdown, click here.
Shear welcomes contributions from the open source community. Submit Issues on GitHub to report bugs or suggest enhancements. To contribute code, fork this repo, commit your changes, and submit a Pull Request following our template. Follow Shear on LinkedIn for updates.
- Saving analyzed functions to DB
- Show ΔPerformance/ΔCost - interpolate data to curve, take derivative
- Automatic optimizations via cron job (EventBridge)
- Albert Hu | GitHub | LinkedIn
- Ari Anguiano | Github | LinkedIn
- Caleb Kao | GitHub | LinkedIn
- Dinesh Wijesekara | GitHub | LinkedIn
- Jonathan Kim | GitHub | LinkedIn
Distributed under the MIT License. See LICENSE.txt for more information.