🐑 lambda-shearer ✂️
lambda-shearer
is a Node CLI tool that helps to configure AWS Lambda function resources properly.
It runs lambda function with a predefined set of memory settings and returns min/max/average for each.
This way, it is easier to make a decision about optimal configuration based on needs and cost.
Usage
Requires Node 8.10 or higher. AWS credentials must be preconfigured before use.
npm install -g lambda-shearer
> lambda-shearer -h Options: --lambda, -l lambda --payload, -p path to a file that contains JSON payload or produces one [required] --region, -r AWS region --repeats, -n number of lambda
Example:
> lambda-shearer -l < RESULTS:128MB: MIN: 5465ms MAX: 8540ms AVG: 6868ms P50: 5565ms P66: 5812ms P75: 6368ms P80: 6410ms P90: 6599ms P95: 6641ms P98: 6768ms P99: 6820ms512MB: MIN: 1292ms MAX: 2350ms AVG: 1696ms P50: 1300ms P66: 1449ms P75: 1533ms P80: 1642ms P90: 1875ms P95: 1990ms P98: 2000ms P99: 2125ms1024MB: MIN: 495ms MAX: 896ms AVG: 690ms P50: 50ms P66: 160ms P75: 240ms P80: 240ms P90: 350ms P95: 400ms P98: 490ms P99: 590ms
Limitations
Tool does not handle failed invocations.
Code style
This repository is configured with EditorConfig and ESLint rules.
Contributing
Contributors and PRs are always welcome.
License
The MIT License (MIT)
Copyright (c) 2017-2019 Anton Bazhal
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.