AWS Lambda Power Tuning is a state machine powered by AWS Step Functions that helps you optimize your Lambda functions for cost and/or performance in a data-driven way.
The state machine is designed to be easy to deploy and fast to execute. Also, it's language agnostic so you can optimize any Lambda functions in your account.
Basically, you can provide a Lambda function ARN as input and the state machine will invoke that function with multiple power configurations (from 128MB to 10GB, you decide which values). Then it will analyze all the execution logs and suggest you the best power configuration to minimize cost and/or maximize performance.
Please note that the input function will be executed in your AWS account - performing real HTTP requests, SDK calls, cold starts, etc. The state machine also supports cross-region invocations and you can enable parallel execution to generate results in just a few seconds.
It's pretty simple and you can visually inspect each step in the AWS management console.
The state machine will generate a visualization of average cost and speed for each power configuration.
For example, this is what the results look like for two CPU-intensive functions, which become cheaper AND faster with more power:
How to interpret the chart above: execution time goes from 35s with 128MB to less than 3s with 1.5GB, while being 14% cheaper to run.
How to interpret the chart above: execution time goes from 2.4s with 128MB to 300ms with 1GB, for the very same average cost.
There are a few options documented here.
You can execute the state machine manually or programmatically, see the documentation here.
Here's a typical execution input with basic parameters:
{
"lambdaARN": "your-lambda-function-arn",
"powerValues": [128, 256, 512, 1024],
"num": 50,
"payload": {}
}
Full input documentation here.
The state machine output will look like this:
{
"results": {
"power": "128",
"cost": 0.0000002083,
"duration": 2.906,
"stateMachine": {
"executionCost": 0.00045,
"lambdaCost": 0.0005252,
"visualization": "https://lambda-power-tuning.show/#<encoded_data>"
}
}
}
Full output documentation here.
You can visually inspect the tuning results to identify the optimal tradeoff between cost and performance.
The data visualization tool has been built by the community: it's a static website deployed via AWS Amplify Console and it's free to use. If you don't want to use the visualization tool, you can simply ignore the visualization URL provided in the execution output. No data is ever shared or stored by this tool.
Website repository: matteo-ronchetti/aws-lambda-power-tuning-ui
Optionally, you could deploy your own custom visualization tool and configure the CloudFormation Parameter named visualizationURL
with your own URL.
Lambda Power Tuner UI is a web interface to simplify the deployment and execution of Lambda Power Tuning. It's built and maintained by Matthew Dorrian and it aims at providing a consistent interface and a uniform developer experience across teams and projects.
Power Tuner UI repository: mattymoomoo/aws-power-tuner-ui
Here you can find out more about some advanced features of this project, its internals, and some considerations about security and execution cost.
From most recent to oldest, with major releases in bold:
Feature requests and pull requests are more than welcome!
For this repository, install dev dependencies with npm install
. You can run tests with npm test
, linting with npm run lint
, and coverage with npm run coverage
. Travis will automatically run the test suite on every commit and PR.
aws lambda 无服务器应用程序将软件精简到最低限度:一小段代码,可按需调用和扩展。 无服务器只是小型应用程序的票证,例如简单的API或单个网页,不需要整个服务器或虚拟机的管理开销。 无服务器系统简化了开发人员的生活,并提供了适合工作的规模弹性。 AWS Lambda是目前最著名的无服务器系统之一,但是像亚马逊的许多事物(以及云的许多事物)一样,如果您尝试用裸手抓住它,它可能会割伤您的手指。
无服务器应用程序将软件精简到最低限度:一小段代码,可按需调用和扩展。 Serverless只是小型应用程序的门票,例如简单的API或单个网页,不需要整个服务器或虚拟机的管理开销。 无服务器系统简化了开发人员的生活,并提供了适合工作的规模弹性。 AWS Lambda是目前最著名的无服务器系统之一,但是像亚马逊的许多事物(以及云的许多事物)一样,如果您尝试用裸手抓住它,它可能会割伤您的手指。 这是工具
是否有可能将AWS Lambda与Apache Kafka集成在一起?我想在lambda函数中放一个消费者。当使用者收到消息时,lambda函数执行。
我很难使用基于Java的Lambda函数设置来接收来自SNS的消息。我的函数如下所示: 它编译得很好,我将jar文件上传到Lambda(通过网络控制台)没有任何问题。 但是,当我使用代表SNSEvent模型的JSON发布到它(通过SNS发布到订阅的Lambda函数)时,Lambda函数抛出以下异常: 在类com上加载方法处理程序时出错。我的公司。LambdaHandler:java类。NoClas
在dynamoDB更新中调用lambda函数时,我遇到了问题。我已经检查了AWS Lambda:ClassNotFoundException和AWS Lambda NoClassDefFoundError,但没有成功。 我写这个lambda函数调用时,有任何更新的发电机。我按照这个教程。https://docs.aws.amazon.com/lambda/latest/dg/with-dynamo
Apollo AWS Lambda with GraphQL subscriptions ⚠️ This documentation is currently for 1.0.0-alpha.X package which supports only subscriptions-transport-ws and drops the legacy protocol and client suppor
playwright-aws-lambda Support for Playwright running on AWS Lambda and Google Cloud Functions. NOTE: Currently only Chromium is supported. Install npm install playwright-core playwright-aws-lambda --s
aws-lambda-image An AWS Lambda Function to resize/reduce images automatically. When an image isput on AWS S3 bucket, this package will resize/reduce it and put to S3. Requirements Node.js ( AWS Lambda