Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi! Do you use Lambda Power Tuning? Reach out! #96

Closed
alexcasalboni opened this issue Jun 12, 2020 · 14 comments
Closed

Hi! Do you use Lambda Power Tuning? Reach out! #96

alexcasalboni opened this issue Jun 12, 2020 · 14 comments
Assignees
Labels

Comments

@alexcasalboni
Copy link
Owner

Hi,

I'd love to hear about how you've been using AWS Lambda Power Tuning for your projects and what optimization results you've achieved, whether in production or while prototyping.

You can find me at acasal@amazon.com or on Twitter/LinkedIn 👌

@alexcasalboni alexcasalboni self-assigned this Jun 12, 2020
@alexcasalboni alexcasalboni pinned this issue Jun 12, 2020
@savnik
Copy link

savnik commented Dec 22, 2020

@alexcasalboni just tested it out in our playgrond environment in @BlackbirdHQ - and it is very interesting! We will try it out on our real lambda api services soon and update you.

@alexcasalboni
Copy link
Owner Author

@savnik great! feel free to ping me if you need help or if you have feature requests! (here, LinkedIn or email is OK)

@savnik
Copy link

savnik commented Dec 23, 2020

@alexcasalboni when you calculate cost, is the cost based on 100ms billing or 1ms billing interval?
As you probably know AWS changed billing interval at this year reinvent for lambda.

@alexcasalboni
Copy link
Owner Author

Hi @savnik! The tool is now using the new 1ms billing (see #116).

I'm going to update some references and screenshots in the documentation asap too.

@selzinga
Copy link

selzinga commented Mar 1, 2021

Alex, I just found your project and this is outstanding! I have been playing around with it and the output so far has been very useful. I would go so far as to say this should be a standard part of the AWS compute optimizer for lambda. Very nicely done, thank you for providing this!

@alexcasalboni
Copy link
Owner Author

Thanks for your feedback and kind words, @selzinga 🙏
Feel free to reach out or open a new issue in case of issues or feature requests :)

@brendonparker
Copy link

brendonparker commented Apr 23, 2021

I'm playing with it. Pretty neat! Is there any way to get the raw data. Curious to see the min/max times, not just the average.

EDIT
Just wanted to say, this is totally awesome. Saved me so much time in setting up some quick benchmarks.

@selzinga
Copy link

I'm playing with it. Pretty neat! Is there any way to get the raw data. Curious to see the min/max times, not just the average.

You can grab the raw data from the Cloudwatch logs. It is grabbing the Report lines with the Duration for each function and you can inspect those manually. I found it worth checking the logs anyway to look for any unexpected errors in the runs.

@alexcasalboni
Copy link
Owner Author

alexcasalboni commented Apr 25, 2021 via email

@uglow
Copy link

uglow commented Apr 28, 2022

Yes, I've been using it for 3 months and it's great! For the project I'm working on, we had a lot of existing payload files which I didn't want to copy into the PoerTune config. So I wrote a NodeJS-version of the execution script which allows the config files to include external JSON or JS files (which have a default exported function (and also allow for arguments to be passed to the function)). This keeps the config files small and allows us to dynamically build the payload when required (e.g. converting a PDF to base64)

@alexcasalboni
Copy link
Owner Author

Hey @uglow 👋 thanks for sharing!

Have you considered using the new S3 payload integration? (documentation here)

The feature was meant to support large payloads (above the Step Functions limit), but it sounds like a good fit for your situation 😄 With a combination of S3 payloads and weighted payloads, you should be able to reuse most of your existing files without maintaining your own custom NodeJS version of Lambda Power Tuning 👌

@uglow
Copy link

uglow commented Apr 29, 2022

Have you considered using the new S3 payload integration? (documentation here)

That's good to know - thanks for pointing that out. But I still needed a way to pre-process the PDF into Base64 for the Lambda event, and that's where having a JS function made all the difference.

@orenbenya
Copy link

Hi, testing out the Lambda Tuning tool, looks great!
I was wondering if the cost is hard coded, or are you getting it from elsewhere (I saw sfCosts as a parameter)?

While using Terraform, it got connected to local roles that are not related to the TF deployment, I wonder how they got inside (-: , I noticed it when I was trying to run terraform destroy operation.

Running the Lambda application does make everything easier..

I saw some discrepancy between what the Tuning tool said while testing for example it will take 100 ms, but the lambda logs should 340ms for example, I understand the result the tool provides is a median of all results (not including function init) ?

One last thing , can you say how the link for the visualization is hashed \ encrypted ?

Many thanks for this great tool!

@alexcasalboni
Copy link
Owner Author

Hi @orenbenya! Thanks for reaching out :)

  1. The cost of Lambda is hard-coded in the CloudFormation template. This includes the Lambda cost by region and based on the architecture (x86 or arm).
  2. Can you tell me more about these local roles?
  3. Yes, the tool computes some kind of average (discarding the top/bottom results to avoid cold starts). You can adjust this behaviour using the discardTopBottom input parameter.
  4. You can find the visualization URL hashing logic here. Basically, it concatenates all the values related to power, duration, and cost (as base64). It's a simple and reversible transformation to make all those values URL-safe. Also, that hash doesn't include any identifiable information about your Lambda function or AWS Account. It's just raw numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants