Skip to content

Commit

Permalink
updated cost-related doc (new state)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcasalboni committed Oct 24, 2019
1 parent 5a9b266 commit 8fe1fdc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README-SAR.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Optionally, you could deploy your own custom visualization tool and configure th

There are three main costs associated with AWS Lambda Power Tuning:

* **AWS Step Functions cost**: it corresponds to the number of state transitions during the state machine execution; this cost depends on the number of tested power values, and it's approximately `0.000025 * (5 + N)` where `N` is the number of power values; for example, if you test 6 power values, the state machine cost will be $0.000275
* **AWS Step Functions cost**: it corresponds to the number of state transitions during the state machine execution; this cost depends on the number of tested power values, and it's approximately `0.000025 * (6 + N)` where `N` is the number of power values; for example, if you test 6 power values, the state machine cost will be $0.0003
* **AWS Lambda cost** related to your function's executions: it depends on three factors: 1) number of invocations that you configure as input (`num`), the number of tested power configurations (`powerValues`), and the average invocation time of your function; for example, if you test all the default power configurations with `num: 100` and all invocations take less than 100ms, the Lambda cost will be approximately $0.001
* **AWS Lambda cost** related to `Initializer`, `Executor`, `Cleaner`, and `Analyzer`: for most cases it's negligible, especially if you enable `parallelInvocation: true`; this cost is not included in the `results.stateMachine` output to keep the state machine simple and easy to read and debug

Expand Down Expand Up @@ -148,6 +148,7 @@ Please note that the total invocation time should stay below 300 seconds (5 min)

## CHANGELOG (SAR versioning)

* *3.1.0*: $LATEST power reset and optional auto-tuning (new Optimizer step)
* *3.0.0*: dynamic parallelism (powerValues as execution parameter)
* *2.1.3*: upgraded runtime to Node.js 10.x
* *2.1.2*: new balanced optimization strategy
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Optionally, you could deploy your own custom visualization tool and configure th

There are three main costs associated with AWS Lambda Power Tuning:

* **AWS Step Functions cost**: it corresponds to the number of state transitions during the state machine execution; this cost depends on the number of tested power values, and it's approximately `0.000025 * (5 + N)` where `N` is the number of power values; for example, if you test 6 power values, the state machine cost will be $0.000275
* **AWS Step Functions cost**: it corresponds to the number of state transitions during the state machine execution; this cost depends on the number of tested power values, and it's approximately `0.000025 * (6 + N)` where `N` is the number of power values; for example, if you test 6 power values, the state machine cost will be $0.0003
* **AWS Lambda cost** related to your function's executions: it depends on three factors: 1) number of invocations that you configure as input (`num`), the number of tested power configurations (`powerValues`), and the average invocation time of your function; for example, if you test all the default power configurations with `num: 100` and all invocations take less than 100ms, the Lambda cost will be approximately $0.001
* **AWS Lambda cost** related to `Initializer`, `Executor`, `Cleaner`, and `Analyzer`: for most cases it's negligible, especially if you enable `parallelInvocation: true`; this cost is not included in the `results.stateMachine` output to keep the state machine simple and easy to read and debug

Expand Down Expand Up @@ -211,6 +211,7 @@ Please note that the total invocation time should stay below 300 seconds (5 min)

## CHANGELOG (SAR versioning)

* *3.1.0*: $LATEST power reset and optional auto-tuning (new Optimizer step)
* *3.0.0*: dynamic parallelism (powerValues as execution parameter)
* *2.1.3*: upgraded runtime to Node.js 10.x
* *2.1.2*: new balanced optimization strategy
Expand Down
4 changes: 2 additions & 2 deletions lambda/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const AWS = require('aws-sdk');
// local reference to this module
const utils = module.exports;

// cost of 5+N state transitions (AWS Step Functions)
module.exports.stepFunctionsCost = (nPower) => +(0.000025 * (5 + nPower)).toFixed(5);
// cost of 6+N state transitions (AWS Step Functions)
module.exports.stepFunctionsCost = (nPower) => +(0.000025 * (6 + nPower)).toFixed(5);


module.exports.allPowerValues = () => {
Expand Down

0 comments on commit 8fe1fdc

Please sign in to comment.